Interface IRoleStore
- Namespace
- Excalibur.A3.Authorization
- Assembly
- Excalibur.A3.Abstractions.dll
Provider-neutral store for role persistence.
public interface IRoleStore
Remarks
Follows the Microsoft ASP.NET Core Identity IRoleStore<TRole> pattern:
minimal CRUD surface (5 methods) with GetService(Type) for ISP extensions.
Methods
DeleteRoleAsync(string, CancellationToken)
Deletes a role by its identifier.
Task<bool> DeleteRoleAsync(string roleId, CancellationToken cancellationToken)
Parameters
roleIdstringThe role identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
GetRoleAsync(string, CancellationToken)
Retrieves a role by its identifier.
Task<RoleSummary?> GetRoleAsync(string roleId, CancellationToken cancellationToken)
Parameters
roleIdstringThe role identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<RoleSummary>
The role, or null if not found.
GetRolesAsync(string?, CancellationToken)
Retrieves all roles for a tenant, or all roles if tenant is null.
Task<IReadOnlyList<RoleSummary>> GetRolesAsync(string? tenantId, CancellationToken cancellationToken)
Parameters
tenantIdstringOptional tenant filter.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<RoleSummary>>
Matching roles.
GetService(Type)
Gets a sub-interface or service from this store.
object? GetService(Type serviceType)
Parameters
serviceTypeTypeThe type of service to retrieve.
Returns
SaveRoleAsync(RoleSummary, CancellationToken)
Saves or updates a role (upsert).
Task SaveRoleAsync(RoleSummary role, CancellationToken cancellationToken)
Parameters
roleRoleSummaryThe role to persist.
cancellationTokenCancellationTokenCancellation token.