LLMS_REST_Students_Progress_Controller::check_read_item_permissions( WP_REST_Request $request )
Determine if the current user can view the requested item.
Parameters Parameters
- $request
-
(WP_REST_Request) (Required) Request object.
Return Return
(bool)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-students-progress-controller.php
protected function check_read_item_permissions( $request ) { // Can read your own progress. if ( get_current_user_id() === $request['id'] ) { return true; } // Must be able to edit post and student to view other's progress. if ( current_user_can( 'edit_post', $request['post_id'] ) && current_user_can( 'edit_students', $request['id'] ) ) { return true; } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |