| @@ -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 | |