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
stringThe ID of the role to assign permissions to.
request
AssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to assign to the role.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
AssignUsersAsync(string, AssignUsersRequest, CancellationToken)
Assigns Users to a role.
Task AssignUsersAsync(string id, AssignUsersRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the role to assign users to.
request
AssignUsersRequestA AssignUsersRequest containing the user IDs to assign to the role.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
CreateAsync(RoleCreateRequest, CancellationToken)
Creates a new role according to the request.
Task<Role> CreateAsync(RoleCreateRequest request, CancellationToken cancellationToken = default)
Parameters
request
RoleCreateRequestThe RoleCreateRequest containing the details of the role to create.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteAsync(string, CancellationToken)
Deletes a role.
Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the role to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetAllAsync(GetRolesRequest, PaginationInfo, CancellationToken)
Retrieves a list of all roles.
Task<IPagedList<Role>> GetAllAsync(GetRolesRequest request, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
request
GetRolesRequestSpecifies criteria to use when querying roles.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe 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
GetRolesRequestSpecifies criteria to use when querying roles.
cancellationToken
CancellationTokenThe 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
stringThe ID of the role to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetPermissionsAsync(string, PaginationInfo, CancellationToken)
Gets the permissions assigned to a role.
Task<IPagedList<Permission>> GetPermissionsAsync(string id, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the role to obtain the permissions for.
pagination
PaginationInfoSpecifies PaginationInfo to use in requesting paged results.
cancellationToken
CancellationTokenThe 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
stringThe ID of the role to query.
pagination
CheckpointPaginationInfoSpecifies CheckpointPaginationInfo to use in requesting checkpoint-paginated results.
cancellationToken
CancellationTokenThe 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
stringThe ID of the role to query.
pagination
PaginationInfoSpecifies PaginationInfo to use in requesting paged results.
cancellationToken
CancellationTokenThe 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
stringThe ID of the role to query.
cancellationToken
CancellationTokenThe 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
stringThe ID of the role to remove permissions from.
request
AssignPermissionsRequestA AssignPermissionsRequest containing the permission identifiers to remove from the role.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UpdateAsync(string, RoleUpdateRequest, CancellationToken)
Updates a role.
Task<Role> UpdateAsync(string id, RoleUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the role to update.
request
RoleUpdateRequestA RoleUpdateRequest containing the information to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.