Astra_API_Init::get_permissions_check( WP_REST_Request $request )

Check whether a given request has permission to read notes.


Description


Parameters

$request

(WP_REST_Request) (Required) Full details about the request.


Return

(WP_Error|boolean)


Source

File: admin/includes/class-astra-api-init.php

	public function get_permissions_check( $request ) {

		if ( ! current_user_can( 'edit_theme_options' ) ) {
			return new WP_Error( 'astra_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'astra' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

Changelog

Changelog
Version Description
4.0.0 Introduced.

User Contributed Notes

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