Class RolePermissionRepository
- Namespace
- KadicAuth.Infrastructure.Repositories
- Assembly
- KadicAuth.Infrastructure.dll
Repository for querying role-permission mappings for authorization
public class RolePermissionRepository : IPermissionRepository
- Inheritance
-
objectRolePermissionRepository
- Implements
-
IPermissionRepository
Constructors
RolePermissionRepository(AuthDbContext)
public RolePermissionRepository(AuthDbContext context)
Parameters
contextAuthDbContext
Methods
GetAllPermissionCodesAsync(CancellationToken)
Returns every permission code currently present in the catalog, ignoring
roles and tenant scoping. Used exclusively by the platform-admin
short-circuit in PermissionService so SuperAdmins appear to the
UI as having every permission. Do NOT use from normal flows.
public Task<HashSet<string>> GetAllPermissionCodesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- Task<HashSet<string>>
GetUserPermissionsAsync(Guid, Guid, Guid, CancellationToken)
Gets all unique permissions for a user based on their role assignments
public Task<HashSet<string>> GetUserPermissionsAsync(Guid userId, Guid tenantId, Guid tenantBranchId, CancellationToken cancellationToken = default)
Parameters
userIdGuidUser ID
tenantIdGuidTenant ID
tenantBranchIdGuidCurrent branch ID
cancellationTokenCancellationTokenCancellation token
Returns
- Task<HashSet<string>>
Set of unique permission codes