LLMS_REST_Instructors_Controller::update_item_permissions_check( WP_REST_Request $request )
Determine if current user has permission to update a user.
Parameters Parameters
- $request
-
(WP_REST_Request) (Required) Request object.
Return Return
(true|WP_Error)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-instructors-controller.php
public function update_item_permissions_check( $request ) { if ( get_current_user_id() === $request['id'] ) { return true; } if ( ! current_user_can( 'edit_users', $request['id'] ) ) { return llms_rest_authorization_required_error( __( 'You are not allowed to edit this instructor.', 'lifterlms' ) ); } return $this->check_roles_permissions( $request ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.13 | Refer to the instructor role on the authorization error message rather than the generic 'user'. |
1.0.0-beta.1 | Introduced. |