You are here

protected function GenericResource::checkInvalidPermissions in Auth0 Single Sign On 8.2

Check for invalid permissions with an array of permissions.

Parameters

array $permissions Permissions array to check.:

Return value

void

Throws

InvalidPermissionsArrayException If permissions are empty or do not contain the necessary keys.

4 calls to GenericResource::checkInvalidPermissions()
Roles::addPermissions in vendor/auth0/auth0-php/src/API/Management/Roles.php
Associate permissions with a role. Required scope: "update:roles"
Roles::removePermissions in vendor/auth0/auth0-php/src/API/Management/Roles.php
Delete permissions from a role. Required scope: "update:roles"
Users::addPermissions in vendor/auth0/auth0-php/src/API/Management/Users.php
Add one or more permissions to a specific user. Required scope: "update:users"
Users::removePermissions in vendor/auth0/auth0-php/src/API/Management/Users.php
Remove one or more permissions from a specific user. Required scope: "update:users"

File

vendor/auth0/auth0-php/src/API/Management/GenericResource.php, line 100

Class

GenericResource
Class GenericResource. Extended by Management API endpoints classes.

Namespace

Auth0\SDK\API\Management

Code

protected function checkInvalidPermissions(array $permissions) {
  if (empty($permissions)) {
    throw new InvalidPermissionsArrayException();
  }
  foreach ($permissions as $permission) {
    if (empty($permission['permission_name'])) {
      throw new InvalidPermissionsArrayException();
    }
    if (empty($permission['resource_server_identifier'])) {
      throw new InvalidPermissionsArrayException();
    }
  }
}