Data Layer medium complexity backendmobile
0
Dependencies
2
Dependents
1
Entities
0
Integrations

Description

Data access layer for role assignment records in the PostgreSQL user_roles table. Handles CRUD operations for role assignments, supports multi-organization membership, and provides a local cache on the mobile client for offline permission checks.

Feature: Role-Based Access Control

permissions-repository

Responsibilities

  • Query and persist user role assignments from the user_roles PostgreSQL table
  • Support multi-organization role membership (one user, multiple orgs, multiple roles)
  • Cache role assignments in secure local storage on mobile for offline authorization
  • Invalidate cached role data on logout or role revocation events

Interfaces

getUserRoles(userId: String, organizationId: String) -> List<UserRole>
assignRole(userId: String, organizationId: String, role: UserRole) -> void
revokeRole(userId: String, organizationId: String, role: UserRole) -> void
getRolesByOrganization(organizationId: String) -> Map<String, List<UserRole>>
invalidateRoleCache(userId: String) -> void
getAllRoleDefinitions() -> List<RoleDefinition>

Relationships

Dependents (2)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component