Role Switch Option When Peer Mentor Has Multiple Roles
Some users in the system hold multiple roles simultaneously (for example, a user who is both a peer mentor and a coordinator in different chapters). When the permission checker determines that the blocked feature is accessible under a different role the authenticated user possesses, the no-access screen should surface the role switch widget as a secondary action. The role state manager and role resolution service determine which roles the user has and which would satisfy the required permission. The role switch must complete without requiring re-authentication and must update the role-aware bottom navigation accordingly. This aligns with the NHF requirement for handling members belonging to multiple local chapters (up to 5) with distinct roles per chapter.
User Story
Acceptance Criteria
- Given a peer mentor who also holds a coordinator role attempts to access a coordinator-only route, when the no-access screen is shown, then a role switch widget offering the coordinator role is displayed
- Given the role switch widget is displayed and the peer mentor selects the coordinator role, when the role state manager updates the active role, then the user is navigated to the originally requested route without re-authentication
- Given a peer mentor has only one role and lacks permission for the blocked route, when the no-access screen renders, then no role switch option is shown
- Given the peer mentor switches role via the no-access screen, when the role switch completes, then the role-aware bottom navigation reflects the new active role
- Given the peer mentor switches to a role from the no-access screen, when they later navigate back, then the system remembers the last active role and does not revert unexpectedly
Business Value
Organizations such as NHF have complex multi-chapter structures where an individual may simultaneously be a peer mentor in one chapter and a coordinator in another. Without an inline role switch on the no-access screen, these users face a disruptive logout-and-login cycle that significantly degrades usability. A seamless role switch directly from the denial screen reduces friction, prevents users from abandoning tasks mid-flow, and supports the app's goal of replacing cumbersome manual processes with an efficient digital workflow.
Components
- No-Access Screen ui
- No-Access Screen ui
- Role Switch Widget ui
- Role Resolution Service service
- Role State Manager service
- Permission Checker Service service
- Role Repository data
- Supabase Role Data Provider infrastructure
- Role-Aware Bottom Navigation ui
- Role-Based Home Screen ui