You are here

public function Roles::removePermissions in Auth0 Single Sign On 8.2

Delete permissions from a role. Required scope: "update:roles"

@link https://auth0.com/docs/api/management/v2#!/Roles/delete_role_permission_...

Parameters

string $role_id Role to ID to get permissions.:

array $permissions Permissions to delete, array of permission arrays.:

Return value

mixed

Throws

EmptyOrInvalidParameterException Thrown if the role_id parameter is empty or is not a string.

InvalidPermissionsArrayException Thrown if the permissions parameter is empty or invalid.

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Roles.php, line 203

Class

Roles
Class Roles. Handles requests to the Roles endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function removePermissions($role_id, array $permissions) {
  $this
    ->checkEmptyOrInvalidString($role_id, 'role_id');
  $this
    ->checkInvalidPermissions($permissions);
  $data = [
    'permissions' => $permissions,
  ];
  return $this->apiClient
    ->method('delete')
    ->addPath('roles', $role_id)
    ->addPath('permissions')
    ->withBody(json_encode($data))
    ->call();
}