WordPress at Your Fingertips
function is not described

WC_Auth::get_permissions_in_scope() protected WC 2.4.0

Return a list of permissions a scope allows.

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

Hooks from the method

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_permissions_in_scope( $scope );
$scope(string) (required)
Permission scope.

Changelog

Since 2.4.0 Introduced.

Code of WC_Auth::get_permissions_in_scope() WC 5.8.0

protected function get_permissions_in_scope( $scope ) {
	$permissions = array();
	switch ( $scope ) {
		case 'read':
			$permissions[] = __( 'View coupons', 'woocommerce' );
			$permissions[] = __( 'View customers', 'woocommerce' );
			$permissions[] = __( 'View orders and sales reports', 'woocommerce' );
			$permissions[] = __( 'View products', 'woocommerce' );
			break;
		case 'write':
			$permissions[] = __( 'Create webhooks', 'woocommerce' );
			$permissions[] = __( 'Create coupons', 'woocommerce' );
			$permissions[] = __( 'Create customers', 'woocommerce' );
			$permissions[] = __( 'Create orders', 'woocommerce' );
			$permissions[] = __( 'Create products', 'woocommerce' );
			break;
		case 'read_write':
			$permissions[] = __( 'Create webhooks', 'woocommerce' );
			$permissions[] = __( 'View and manage coupons', 'woocommerce' );
			$permissions[] = __( 'View and manage customers', 'woocommerce' );
			$permissions[] = __( 'View and manage orders and sales reports', 'woocommerce' );
			$permissions[] = __( 'View and manage products', 'woocommerce' );
			break;
	}
	return apply_filters( 'woocommerce_api_permissions_in_scope', $permissions, $scope );
}