Switch Between Active Roles Without Re-Authenticating
Users who hold multiple roles across their organizational memberships can toggle their active role via the Role Switch Widget without re-authenticating. When a role switch occurs, the Role Authorization Service re-evaluates permissions for the new role, updates the session's active role state, and triggers a full navigation reset to prevent stale UI state from the prior role context from persisting. The Role Switch Widget is only visible to users with more than one assigned role, ensuring users with a single role are not presented with a confusing control.
User Story
Acceptance Criteria
- Given a user holds more than one role, when they view any screen, then the Role Switch Widget is visible
- Given a user with a single role, when they view any screen, then the Role Switch Widget is not displayed
- Given the Role Switch Widget is visible, when the user selects a different role, then the active role changes without requiring re-authentication
- Given a role switch has occurred, when the navigation state updates, then a full navigation reset is triggered and the user lands on the appropriate home screen for the new role
- Given a role switch has occurred, when the user navigates the app, then all data, routes, and permissions reflect the newly selected role and no data from the prior role context is visible
- Given the role switch completes, when the user views the widget, then it shows the newly active role name
Business Value
Coordinators frequently need to view the app from a peer mentor's perspective to assist with issues or perform proxy registrations. Without a role switch widget, every context change requires a full logout/login cycle, creating significant friction and reducing coordinator productivity. This feature directly supports the multi-role workflows central to how NHF coordinators manage multiple local association memberships.
Components
- Role Switch Widget ui
- Role Authorization Service service
- Permission Guard service
- Role Config Store data