canManage()) { return new WP_Error( 'rest_forbidden', __('You don\'t have the right permissions to view Migrations', 'give'), ['status' => $this->authorizationStatusCode()] ); } return true; } // Sets up the proper HTTP status code for authorization. public function authorizationStatusCode() { if (is_user_logged_in()) { return 403; } return 401; } }