Auth0-PHP

Roles extends ManagementEndpoint
in package
implements RolesInterface

Class Roles.

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

Tags
see
https://auth0.com/docs/api/management/v2#!/Roles

Interfaces, Classes, Traits and Enums

RolesInterface
Interface RolesInterface.

Table of Contents

$httpClient  : HttpClient
__construct()  : mixed
ManagementEndpoint constructor.
addPermissions()  : ResponseInterface
Associate permissions with a role.
addUsers()  : ResponseInterface
Add one or more users to a role.
create()  : ResponseInterface
Create a new Role.
delete()  : ResponseInterface
Delete a single Role by ID.
get()  : ResponseInterface
Get a single Role by ID.
getAll()  : ResponseInterface
Get all Roles Required scope: `read:roles`.
getHttpClient()  : HttpClient
Get the injected HttpClient instance.
getLastRequest()  : HttpRequest|null
Return an instance of HttpRequest representing the last issued request.
getPermissions()  : ResponseInterface
Get the permissions associated to a role.
getResponsePaginator()  : HttpResponsePaginator
Return a ResponsePaginator instance configured for the last HttpRequest.
getUsers()  : ResponseInterface
Get users assigned to a specific role.
instance()  : static
removePermissions()  : ResponseInterface
Delete permissions from a role.
update()  : ResponseInterface
Update a Role by ID.

Properties

Methods

__construct()

ManagementEndpoint constructor.

public final __construct(HttpClient $httpClient) : mixed
Parameters
$httpClient : HttpClient

httpClient instance to use

Return values
mixed

addPermissions()

Associate permissions with a role.

public addPermissions(string $id, array<string|int, mixed> $permissions[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:roles.

Parameters
$id : string

role ID to get permissions

$permissions : array<string|int, mixed>
$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

addUsers()

Add one or more users to a role.

public addUsers(string $id, array<string|int, mixed> $users[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:roles.

Parameters
$id : string

role ID to add users

$users : array<string|int, mixed>

array of user IDs to add to the role

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

create()

Create a new Role.

public create(string $name[, array<string|int, mixed>|null $body = null ][, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: create:roles.

Parameters
$name : string

role name

$body : array<string|int, mixed>|null = null

Optional. Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

delete()

Delete a single Role by ID.

public delete(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: delete:roles.

Parameters
$id : string

role ID to delete

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

get()

Get a single Role by ID.

public get(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:roles.

Parameters
$id : string

role ID to get

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getAll()

Get all Roles Required scope: `read:roles`.

public getAll([array<string|int, mixed>|null $parameters = null ][, RequestOptions|null $options = null ]) : ResponseInterface
Parameters
$parameters : array<string|int, mixed>|null = null

Optional. Query parameters to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getPermissions()

Get the permissions associated to a role.

public getPermissions(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: read:roles.

Parameters
$id : string

role ID to get permissions

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

getUsers()

Get users assigned to a specific role.

public getUsers(string $id[, RequestOptions|null $options = null ]) : ResponseInterface

Required scopes:

  • read:roles
  • read:users.
Parameters
$id : string

role ID assigned to users

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

removePermissions()

Delete permissions from a role.

public removePermissions(string $id, array<string|int, mixed> $permissions[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:roles.

Parameters
$id : string

role ID to get permissions

$permissions : array<string|int, mixed>
$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

update()

Update a Role by ID.

public update(string $id, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface

Required scope: update:roles.

Parameters
$id : string

role ID update

$body : array<string|int, mixed>

Additional body content to pass with the API request. See @see for supported options.

$options : RequestOptions|null = null

Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)

Return values
ResponseInterface

Search results