• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WC_Auth::get_permissions_in_scope() – Return a list of permissions a scope allows.

You appear to be a bot. Output may be restricted

Description

Return a list of permissions a scope allows.

Usage

$array = WC_Auth::get_permissions_in_scope( $scope );

Parameters

$scope
( string ) required – Permission scope.

Returns

array

Source

File name: woocommerce/includes/class-wc-auth.php


Lines:

1 to 27 of 27
  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 );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 10th December 2020

Primary Sidebar

Information

Function name: WC_Auth::get_permissions_in_scope
Class ref: WC_Auth
Plugin ref: WooCommerce
Version: 4.8.0
Sourcefile: includes/class-wc-auth.php
File ref: includes/class-wc-auth.php
Deprecated?: No
API Letters: A,G,I,P,W

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites