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

Description

Caches the role-permission matrix locally on the device to allow the Role Guard Service to evaluate permissions without a network call, supporting offline access control. Syncs the matrix from the backend on authentication and on role changes.

Feature: Role-Based Access Control

permissions-repository

Responsibilities

  • Cache the role-to-permission mapping locally for offline use
  • Provide fast synchronous permission lookups for the Role Guard Service
  • Sync permission matrix from backend after login or role change
  • Invalidate and refresh cache on session expiry or role update

Interfaces

getPermissionsForRole(UserRole role) → List<String>
hasPermission(UserRole role, String permission) → bool
syncPermissionMatrix() → Future<void>
cachePermissionMatrix(Map<String, List<String>> matrix) → Future<void>
clearCache() → Future<void>
getLastSyncedAt() → DateTime?
watchPermissionChanges() → Stream<Map<String, List<String>>>

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component