Service Layer high complexity mobile
0
Dependencies
0
Dependents
15
Entities
0
Integrations

Description

Core BLoC-based service that manages the active role state for the current session. Evaluates which roles a user holds, determines the active organizational context, and exposes role-gated permission checks consumed by the Permission Guard. Integrates with Riverpod for dependency injection across the widget tree.

Feature: Role-Based Access Control

role-authorization-service

Responsibilities

  • Load and cache user roles and memberships from repository
  • Manage active role and organization context state
  • Expose permission check API for route guards and UI components
  • Handle role switching and permission re-evaluation

Interfaces

initialize(userId)
getActiveRole()
getActiveOrganization()
setActiveRole(roleId)
setActiveOrganization(orgId)
hasPermission(permission)
getAvailableRoles()
clearSession()