Astra_Addon_Theme_Builder::get_permissions_check( WP_REST_Request $request )

Check whether a given request has permission access route.


Description


Parameters

$request

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


Return

(WP_Error|boolean)


Source

File: addons/advanced-hooks/classes/class-astra-addon-theme-builder.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-addon' ), array( 'status' => rest_authorization_required_code() ) );
			}
			return true;
		}

Changelog

Changelog
Version Description
4.5.0 Introduced.

User Contributed Notes

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