WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API

OnboardingTasks::get_tasks_permission_check() public WC 1.0

Check if a given request has access to manage woocommerce.

{} It's a method of the class: OnboardingTasks{}

No Hooks.

Return

WP_Error|true|false.

Usage

$OnboardingTasks = new OnboardingTasks();
$OnboardingTasks->get_tasks_permission_check( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of OnboardingTasks::get_tasks_permission_check() WC 6.1.1

public function get_tasks_permission_check( $request ) {
	if ( ! current_user_can( 'manage_woocommerce' ) ) {
		return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
	}

	return true;
}