Automattic\WooCommerce\Internal\RestApi\Routes\V4\Fulfillments

Controller::check_permission_for_providerspublicWC 10.5.0

Check permissions for accessing shipping providers.

Метод класса: Controller{}

Хуков нет.

Возвращает

true|false|WP_Error. True if the current user has the capability, otherwise a WP_Error.

Использование

$Controller = new Controller();
$Controller->check_permission_for_providers( $request );
$request(WP_REST_Request) (обязательный)
Full details about the request.

Список изменений

С версии 10.5.0 Введена.

Код Controller::check_permission_for_providers() WC 10.5.2

public function check_permission_for_providers( WP_REST_Request $request ) {
	if ( ! current_user_can( 'manage_woocommerce' ) ) {
		return $this->get_authentication_error_by_method( $request->get_method() );
	}

	return true;
}