Class RoleAssignmentCache
- Namespace
- FoundationaLLM.AuthorizationEngine.Services
- Assembly
- FoundationaLLM.AuthorizationEngine.dll
In-memory cache for role assignments.
public class RoleAssignmentCache
- Inheritance
-
RoleAssignmentCache
- Inherited Members
- Extension Methods
Constructors
RoleAssignmentCache(RoleAssignmentStore)
Creates a new instance of the RoleAssignmentCache class.
public RoleAssignmentCache(RoleAssignmentStore roleAssignmentStore)
Parameters
roleAssignmentStore
RoleAssignmentStoreThe role assignment store containing the role assignments used to initialize the cache.
Methods
AddOrUpdateRoleAssignment(RoleAssignment)
Adds or updates a role assignment in the cache.
public void AddOrUpdateRoleAssignment(RoleAssignment roleAssignment)
Parameters
roleAssignment
RoleAssignmentThe RoleAssignment to add or update in the cache.
GetRoleAssignments(string)
Gets all role assignments for a principal.
public List<RoleAssignment> GetRoleAssignments(string principalId)
Parameters
principalId
stringThe unique identifier of the principal for which role assignments are retrieved.
Returns
RemoveRoleAssignment(string)
Removes a role assignment from the cache.
public void RemoveRoleAssignment(string roleAssignmentId)
Parameters
roleAssignmentId
stringThe unique identifier of the role assigment to be removed.