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

Description

Manages the in-memory and secure-storage representation of the authenticated user's available roles and their currently active role selection. Roles are populated once at login and cached locally so that all subsequent role switches are instant and offline-capable.

Feature: Profile Switching

active-role-cache

Responsibilities

  • Store the full list of roles assigned to the authenticated user after login resolution
  • Persist the currently active role ID to secure local storage across app restarts
  • Expose reactive streams for the active role so dependent widgets can rebuild automatically
  • Invalidate and refresh the role cache on logout or session expiry

Interfaces

setAvailableRoles(List<UserRole> roles)
getAvailableRoles()
setActiveRole(String roleId)
getActiveRole()
watchActiveRole()
clearCache()
hydrateFromStorage()

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component