Role-Based Access Control
Feature Detail
Description
Role-based access control enforces which screens, API endpoints, and data each authenticated user can reach based on their assigned role within their organization. The four roles - Peer Mentor, Coordinator, Organization Admin, and Global Admin - each have distinct access boundaries. The mobile app mounts only the navigation and screens belonging to the user's role via the Module Registry, while the backend validates role claims on every protected request. Users reaching surfaces outside their role see a dedicated no-access screen with clear redirection guidance.
Analysis
RBAC is a prerequisite for every feature that distinguishes between peer mentor and coordinator workflows, making it a critical MVP requirement. Without it, coordinators cannot reach proxy registration or team reporting, and admins cannot access the admin portal. It also enforces the data isolation requirement that Global Admins must not have default access to any organization's operational data - a compliance and trust requirement stated explicitly by all three workshop organizations. Establishing correct role boundaries at MVP avoids a costly security refactor when higher-privilege roles and multi-organization scenarios are introduced in subsequent phases.
Role claims are embedded in the JWT access token as a standard array claim. Backend middleware reads and validates the claim on every protected endpoint before the handler executes; no role check is delegated to the application layer. The mobile app decodes the role from the token at session start and passes it to the Module Registry, which mounts only navigation items and screens authorized for that role. Role changes take effect at the next token refresh so promotions apply without a forced logout. The no-access screen is a static Flutter widget with a clear message and a deep link to the admin portal for users with no mobile role.
Components (43)
Shared Components
These components are reused across multiple features
User Interface (9)
Service Layer (15)
Data Layer (8)
Infrastructure (7)
User Stories
No user stories have been generated for this feature yet.