PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
← All changes | src/API/Endpoints/Migrations/Endpoint.php +4 -2 2.30.04.16.9 View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace Give\API\Endpoints\Migrations;
4 4
5 5 use Give\API\RestRoute;
6 +use Give\Framework\Permissions\Facades\UserPermissions;
6 7 use WP_Error;
7 8
8 9 /**
9 10 * Class Endpoint
@@ -8,8 +9,9 @@
8 9 /**
9 10 * Class Endpoint
10 11 * @package Give\API\Endpoints\Migrations
11 12 *
13 + * @since 4.14.0 update permission capability to use facade
12 14 * @since 2.10.0
13 15 */
14 16 abstract class Endpoint implements RestRoute
15 17 {
@@ -24,12 +26,12 @@
24 26 * @return bool|WP_Error
25 27 */
26 28 public function permissionsCheck()
27 29 {
28 - if ( ! current_user_can('manage_give_settings')) {
30 + if ( ! UserPermissions::settings()->canManage()) {
29 31 return new WP_Error(
30 32 'rest_forbidden',
31 - esc_html__('You dont have the right permissions to view Migrations', 'give'),
33 + __('You don\'t have the right permissions to view Migrations', 'give'),
32 34 ['status' => $this->authorizationStatusCode()]
33 35 );
34 36 }
35 37