WordPress at a glance
function is not described

WC_REST_Authentication::check_permissions() private WC 1.0

Check that the API keys provided have the proper key-specific permissions to either read or write API resources.

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

No Hooks.

Return

true|false|WP_Error. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->check_permissions( $method );
$method(string) (required)
Request method.

Code of WC_REST_Authentication::check_permissions() WC 5.4.1

<?php
private function check_permissions( $method ) {
	$permissions = $this->user->permissions;

	switch ( $method ) {
		case 'HEAD':
		case 'GET':
			if ( 'read' !== $permissions && 'read_write' !== $permissions ) {
				return new WP_Error( 'woocommerce_rest_authentication_error', __( 'The API key provided does not have read permissions.', 'woocommerce' ), array( 'status' => 401 ) );
			}
			break;
		case 'POST':
		case 'PUT':
		case 'PATCH':
		case 'DELETE':
			if ( 'write' !== $permissions && 'read_write' !== $permissions ) {
				return new WP_Error( 'woocommerce_rest_authentication_error', __( 'The API key provided does not have write permissions.', 'woocommerce' ), array( 'status' => 401 ) );
			}
			break;
		case 'OPTIONS':
			return true;

		default:
			return new WP_Error( 'woocommerce_rest_authentication_error', __( 'Unknown request method.', 'woocommerce' ), array( 'status' => 401 ) );
	}

	return true;
}