Table of Contents

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

roleId string

The role identifier.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

true if the role was deleted; false if not found.

GetRoleAsync(string, CancellationToken)

Retrieves a role by its identifier.

Task<RoleSummary?> GetRoleAsync(string roleId, CancellationToken cancellationToken)

Parameters

roleId string

The role identifier.

cancellationToken CancellationToken

Cancellation 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

tenantId string

Optional tenant filter.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<RoleSummary>>

Matching roles.

GetService(Type)

Gets a sub-interface or service from this store.

object? GetService(Type serviceType)

Parameters

serviceType Type

The type of service to retrieve.

Returns

object

The service instance, or null if not supported.

SaveRoleAsync(RoleSummary, CancellationToken)

Saves or updates a role (upsert).

Task SaveRoleAsync(RoleSummary role, CancellationToken cancellationToken)

Parameters

role RoleSummary

The role to persist.

cancellationToken CancellationToken

Cancellation token.

Returns

Task