Table of Contents

Interface IRolesClient

Namespace
Auth0.ManagementApi.Clients
Assembly
Auth0.ManagementApi.dll
public interface IRolesClient

Methods

AssignPermissionsAsync(string, AssignPermissionsRequest, CancellationToken)

Assign permissions to a role.

Task AssignPermissionsAsync(string id, AssignPermissionsRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to assign permissions to.

request AssignPermissionsRequest

A AssignPermissionsRequest containing the permission identifiers to assign to the role.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous assignment operation.

AssignUsersAsync(string, AssignUsersRequest, CancellationToken)

Assigns Users to a role.

Task AssignUsersAsync(string id, AssignUsersRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to assign users to.

request AssignUsersRequest

A AssignUsersRequest containing the user IDs to assign to the role.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous assign operation.

CreateAsync(RoleCreateRequest, CancellationToken)

Creates a new role according to the request.

Task<Role> CreateAsync(RoleCreateRequest request, CancellationToken cancellationToken = default)

Parameters

request RoleCreateRequest

The RoleCreateRequest containing the details of the role to create.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Role>

The newly created Role.

DeleteAsync(string, CancellationToken)

Deletes a role.

Task DeleteAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

GetAllAsync(GetRolesRequest, PaginationInfo, CancellationToken)

Retrieves a list of all roles.

Task<IPagedList<Role>> GetAllAsync(GetRolesRequest request, PaginationInfo pagination, CancellationToken cancellationToken = default)

Parameters

request GetRolesRequest

Specifies criteria to use when querying roles.

pagination PaginationInfo

Specifies pagination info to use when requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Role>>

An IPagedList<T> containing the roles requested.

GetAllAsync(GetRolesRequest, CancellationToken)

Retrieves a list of all roles.

Task<IPagedList<Role>> GetAllAsync(GetRolesRequest request, CancellationToken cancellationToken = default)

Parameters

request GetRolesRequest

Specifies criteria to use when querying roles.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Role>>

An IPagedList<T> containing the roles

GetAsync(string, CancellationToken)

Retrieves a role by its ID.

Task<Role> GetAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to retrieve.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Role>

The Role that was requested.

GetPermissionsAsync(string, PaginationInfo, CancellationToken)

Gets the permissions assigned to a role.

Task<IPagedList<Permission>> GetPermissionsAsync(string id, PaginationInfo pagination, CancellationToken cancellationToken = default)

Parameters

id string

The id of the role to obtain the permissions for.

pagination PaginationInfo

Specifies PaginationInfo to use in requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Permission>>

An IPagedList<T> containing the assigned permissions for this role.

GetUsersAsync(string, CheckpointPaginationInfo, CancellationToken)

Retrieves a list of users associated with a role.

Task<ICheckpointPagedList<AssignedUser>> GetUsersAsync(string id, CheckpointPaginationInfo pagination, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to query.

pagination CheckpointPaginationInfo

Specifies CheckpointPaginationInfo to use in requesting checkpoint-paginated results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<ICheckpointPagedList<AssignedUser>>

An IPagedList<T> containing the assigned users.

GetUsersAsync(string, PaginationInfo, CancellationToken)

Retrieves a list of users associated with a role.

Task<IPagedList<AssignedUser>> GetUsersAsync(string id, PaginationInfo pagination, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to query.

pagination PaginationInfo

Specifies PaginationInfo to use in requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<AssignedUser>>

An IPagedList<T> containing the assigned users.

GetUsersAsync(string, CancellationToken)

Retrieves a list of users associated with a role.

Task<IPagedList<AssignedUser>> GetUsersAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to query.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<AssignedUser>>

An IPagedList<T> containing the assigned users.

RemovePermissionsAsync(string, AssignPermissionsRequest, CancellationToken)

Remove permissions assigned to a role.

Task RemovePermissionsAsync(string id, AssignPermissionsRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to remove permissions from.

request AssignPermissionsRequest

A AssignPermissionsRequest containing the permission identifiers to remove from the role.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous remove operation.

UpdateAsync(string, RoleUpdateRequest, CancellationToken)

Updates a role.

Task<Role> UpdateAsync(string id, RoleUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the role to update.

request RoleUpdateRequest

A RoleUpdateRequest containing the information to update.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Role>

The newly updated Role.