LLMS_Rest_Admin_Settings_API_Keys::authorize_key_owner( int $user_id )

Ensure the current user is allowed to assign the requested key owner.


Parameters Parameters

$user_id

(int) (Required) WP_User ID of the requested key owner.


Top ↑

Return Return

(WP_Error|true) Returns true when authorized or a WP_Error when not.


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/admin/class-llms-rest-admin-settings-api-keys.php

	protected static function authorize_key_owner( $user_id ) {

		if ( $user_id && ! current_user_can( 'edit_user', (int) $user_id ) ) {
			return new WP_Error( 'llms_rest_key_invalid_user_id', __( 'You are not allowed to assign this user as the key owner.', 'lifterlms' ) );
		}

		return true;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.7 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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