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.


Top ↑

Return Return

(bool)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.