Back to Node Auth0

Class RolesClient

docs/classes/management.SDK.RolesClient-1.html

5.9.19.5 KB
Original Source

Class RolesClient

Index

Accessors

permissionsusers

Constructors

constructor

Methods

listcreategetdeleteupdate

Properties

_options_permissions_users

Accessors

permissions

get permissions(): PermissionsClient

Returns PermissionsClient

users

get users(): UsersClient

Returns UsersClient

Constructors

constructor

new RolesClient(options: BaseClientOptions): RolesClient

Parameters

Returns RolesClient

Methods

list

list(
request?: ListRolesRequestParameters,
requestOptions?: RolesClient.RequestOptions,
): Promise<Page<Role, ListRolesOffsetPaginatedResponseContent>>

Retrieve detailed list of user roles created in your tenant.

Note : The returned list does not include standard roles available for tenant members, such as Admin or Support Access.

Parameters

Request-specific configuration.

Returns Promise<Page<Role, ListRolesOffsetPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.roles.list({ per_page: 1, page: 1, include_totals: true, name_filter: "name_filter" })Copy

create

create(
request: CreateRoleRequestContent,
requestOptions?: RolesClient.RequestOptions,
): HttpResponsePromise<CreateRoleResponseContent>

Create a user role for Role-Based Access Control.

Note : New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<CreateRoleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.roles.create({ name: "name" })Copy

get

get(
id: string,
requestOptions?: RolesClient.RequestOptions,
): HttpResponsePromise<GetRoleResponseContent>

Retrieve details about a specific user role specified by ID.

Parameters

  • id: string

ID of the role to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<GetRoleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.roles.get("id")Copy

delete

delete(
id: string,
requestOptions?: RolesClient.RequestOptions,
): HttpResponsePromise<void>

Delete a specific user role from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone.

Parameters

  • id: string

ID of the role to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.roles.delete("id")Copy

update

update(
id: string,
request?: UpdateRoleRequestContent,
requestOptions?: RolesClient.RequestOptions,
): HttpResponsePromise<UpdateRoleResponseContent>

Modify the details of a specific user role specified by ID.

Parameters

  • id: string

ID of the role to update.

Request-specific configuration.

Returns HttpResponsePromise<UpdateRoleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.roles.update("id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Protected_permissions

_permissions: PermissionsClient | undefined

Protected_users

_users: UsersClient | undefined

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Accessors permissionsusers Constructors constructor Methods listcreategetdeleteupdate Properties _options_permissions_users