You are here

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

Get the permissions associated to a role. Required scope: "read:roles"

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

Parameters

string $role_id Role to ID to get permissions.:

array $params Additional parameters to send with the request.:

Return value

mixed

Throws

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

\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 145

Class

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

Namespace

Auth0\SDK\API\Management

Code

public function getPermissions($role_id, array $params = []) {
  $this
    ->checkEmptyOrInvalidString($role_id, 'role_id');
  $params = $this
    ->normalizePagination($params);
  $params = $this
    ->normalizeIncludeTotals($params);
  return $this->apiClient
    ->method('get')
    ->addPath('roles', $role_id)
    ->addPath('permissions')
    ->withDictParams($params)
    ->call();
}