RoleAssignmentWidget
Component Detail
Description
Admin Web Portal widget for viewing and changing a user's functional role. Renders a role selector with the current role pre-selected and submits changes through AdminRoleService. Displays a contextual notice explaining that the new role takes effect on the user's next JWT refresh.
role-assignment-widget
Sources & reasoning
Blueprint tags role-assignment [MVP]. Source lines 256 and 258 define the role access boundaries - mobile-only for Peer Mentor and Coordinator, portal-primary for Org Admin surfaced as Coordinator on mobile - making role assignment the mechanism that enforces these boundaries at onboarding. Line 326 lists rolletildeling as an explicit Admin Web Portal MVP item. Target release is MVP per both sources.
-
docs/source/likeperson.md · line 256Managed (invited, assigned, deactivated) by Org Admin from the admin portal, but does not log in to the admin portal.
-
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.
Responsibilities
- Render role selector pre-populated with the user's current role (Peer Mentor, Coordinator, Org Admin)
- Submit role change requests and surface success or error feedback inline
- Display next-login-effect notice so admins understand deferred propagation
- Enforce UI-level constraint preventing selection of roles that violate platform boundary rules
- Reflect the Org Admin → Coordinator mobile transparency without exposing a separate UI path
Interfaces
loadUserRole(userId: string): Promise<RoleOption>
submitRoleChange(userId: string, newRole: RoleType): Promise<RoleChangeResult>
onRoleChanged(callback: (result: RoleChangeResult) => void): void
Related Data Entities (2)
Data entities managed by this component