Automattic\WooCommerce\Internal\RestApi\Routes\V4\Customers
Controller::get_allowed_roles
Returns list of allowed roles for the REST API.
Method of the class: Controller{}
Hooks from the method
Returns
Array. $roles Allowed roles to be updated via the REST API.
Usage
// private - for code of main (parent) class only $result = $this->get_allowed_roles(): array;
Controller::get_allowed_roles() Controller::get allowed roles code WC 10.4.3
private function get_allowed_roles(): array {
/**
* Filter the allowed roles for the REST API.
*
* Danger: Make sure that the roles listed here cannot manage the shop.
*
* @param array $roles Array of allowed roles.
*
* @since 9.5.2
*/
return apply_filters( 'woocommerce_rest_customer_allowed_roles', array( 'customer', 'subscriber' ) );
}