Automattic\WooCommerce\Internal\Orders
OrderActionsRestController::check_permissions
Permission check for REST API endpoint.
Method of the class: OrderActionsRestController{}
No Hooks.
Returns
true|false|WP_Error. True if the current user has the capability, otherwise a WP_Error object.
Usage
// private - for code of main (parent) class only $result = $this->check_permissions( $request );
- $request(WP_REST_Request) (required)
- The request for which the permission is checked.
OrderActionsRestController::check_permissions() OrderActionsRestController::check permissions code WC 10.9.4
private function check_permissions( WP_REST_Request $request ) {
$order_id = $this->validate_order_id( $request );
if ( is_wp_error( $order_id ) ) {
return $order_id;
}
return $this->check_permission( $request, 'read_shop_order', $order_id );
}