Automattic\WooCommerce\Admin\API
MarketingCampaignTypes::get_items_permissions_check()
Check whether a given request has permission to view marketing campaigns.
Method of the class: MarketingCampaignTypes{}
No Hooks.
Return
WP_Error|true|false
.
Usage
$MarketingCampaignTypes = new MarketingCampaignTypes(); $MarketingCampaignTypes->get_items_permissions_check( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
MarketingCampaignTypes::get_items_permissions_check() MarketingCampaignTypes::get items permissions check code WC 9.3.3
public function get_items_permissions_check( $request ) { if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) { return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); } return true; }