Profile Switching
Feature Detail
Description
Profile Switching allows a single authenticated user to switch between multiple organizational contexts or role representations within the Meander Mobile App without logging out and back in. The primary use case is an Org Admin who is surfaced as a Coordinator on mobile but may need to act under a different association or context. The feature presents a role/profile switcher widget that updates the active session context, causing the home dashboard, navigation, and available modules to reflect the selected profile. The transition must be seamless and not require re-authentication for each switch. All switched contexts must still respect the module toggle registry and RBAC rules of the selected organization, ensuring no cross-tenant data leakage during context transitions.
Sources & reasoning
The source doc explicitly lists a "role switch" widget in the shared widget inventory (line 305) and calls out multi-association membership (up to 5 local associations, line 109) as an NHF-specific requirement. The Org Admin-as-Coordinator mobile pattern (line 258) reinforces the need. The blueprint assigns this v1.0, consistent with Fase 2 scope for multi-org handling; MVP covers the single-context case first.
-
docs/source/likeperson.md · line 109Håndtering av medlemmer i flere lokallag (opptil 5): Avklare tilhørighet og hindre dobbeltrapportering.
-
docs/source/likeperson.md · line 258On mobile, an Org Admin is surfaced as a Coordinator - they use the same mobile experience as coordinators without a separate UI path.
-
docs/source/likeperson.md · line 305Reusable widgets: AppButton, AppTextField, bottom nav, page header, role switch, custom fields table
Analysis
NHF has members belonging to up to five local associations simultaneously (line 109), creating a real need for users to switch between organizational contexts without friction. Without profile switching, these users would need separate accounts or repeated logouts, increasing support overhead and risking double-reporting errors. Profile switching also supports the Org Admin-as-Coordinator mobile pattern described in the source doc, where admins use the same mobile UI as coordinators. Enabling smooth context switching reduces the operational friction for power users who coordinate across multiple local associations. Deferring this to v1.0 is appropriate because MVP covers the single-context case; the switching capability adds significant value but is not required for initial launch.
Implement a ProfileSwitchWidget accessible from the home screen or hamburger menu. The switch updates the active organization context stored in Riverpod state, triggering a re-render of the module registry and home dashboard without full navigation reset. The backend must return the full set of organizations a user belongs to as part of the bootstrap/session response. Switching context should issue a lightweight API call to update the active tenant scope on the session, after which subsequent API calls carry the new org context in their JWT claims. Ensure the Drift local DB correctly scopes cached data per organization to prevent cross-org data surfacing. The ProfileSwitchService must clear or re-scope the local cache on switch to avoid stale data from the previous context.
Components (6)
Shared Components
These components are reused across multiple features
User Stories
No user stories have been generated for this feature yet.