Back to Node Auth0

Class RolesClient

docs/classes/management.SDK.RolesClient.html

5.9.16.9 KB
Original Source

Class RolesClient

Index

Constructors

constructor

Methods

listassigndelete

Properties

_options

Constructors

constructor

new RolesClient(options: BaseClientOptions): RolesClient

Parameters

Returns RolesClient

Methods

list

list(
id: string,
user_id: string,
request?: ListOrganizationMemberRolesRequestParameters,
requestOptions?: RolesClient.RequestOptions,
): Promise<
Page<Role, ListOrganizationMemberRolesOffsetPaginatedResponseContent>,
>

Retrieve detailed list of roles assigned to a given user within the context of a specific Organization.

Users can be members of multiple Organizations with unique roles assigned for each membership. This action only returns the roles associated with the specified Organization; any roles assigned to the user within other Organizations are not included.

Parameters

  • id: string

Organization identifier.

  • user_id: string

ID of the user to associate roles with.

Request-specific configuration.

Returns Promise<Page<Role, ListOrganizationMemberRolesOffsetPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.organizations.members.roles.list("id", "user_id", { page: 1, per_page: 1, include_totals: true })Copy

assign

assign(
id: string,
user_id: string,
request: AssignOrganizationMemberRolesRequestContent,
requestOptions?: RolesClient.RequestOptions,
): HttpResponsePromise<void>

Assign one or more roles to a user to determine their access for a specific Organization.

Users can be members of multiple Organizations with unique roles assigned for each membership. This action assigns roles to a user only for the specified Organization. Roles cannot be assigned to a user across multiple Organizations in the same call.

Parameters

  • id: string

Organization identifier.

  • user_id: string

ID of the user to associate roles with.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.organizations.members.roles.assign("id", "user_id", { roles: ["roles"] })Copy

delete

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

Remove one or more Organization-specific roles from a given user.

Users can be members of multiple Organizations with unique roles assigned for each membership. This action removes roles from a user in relation to the specified Organization. Roles assigned to the user within a different Organization cannot be managed in the same call.

Parameters

  • id: string

Organization identifier.

  • user_id: string

User ID of the organization member to remove roles from.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.organizations.members.roles.delete("id", "user_id", { roles: ["roles"] })Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listassigndelete Properties _options