Assign and Reassign Users to Organizational Units
Users in the system (particularly peer mentors and coordinators) must be formally assigned to one or more organizational units. NHF specifically requires handling members who belong to up to 5 local chapters simultaneously. The assignment panel must clearly show current assignments, allow adding or removing unit affiliations, and trigger appropriate RLS policy updates so that the user's data access is immediately adjusted. Reassignments must audit-log who made the change and when.
User Story
Acceptance Criteria
- Given I am managing a peer mentor's profile, when I open the unit assignment panel, then I see all current organizational unit affiliations for that user
- Given I add a new unit affiliation for a peer mentor, when the assignment is saved, then the peer mentor can immediately register activities attributed to the new unit
- Given a peer mentor belongs to multiple chapters, when I view their activity history, then each activity is tagged with the chapter it was attributed to
- Given I remove a unit assignment, when the change is saved, then the user loses access to data scoped to that unit and their future activity registration defaults to remaining units
- Given an assignment change is made, when I view the audit log, then the change entry shows which admin made the update, the timestamp, and the before/after unit assignment state
Business Value
Correct unit assignment is the cornerstone of data isolation, accurate reporting, and appropriate access control. Without precise assignment management, peer mentors may inadvertently access contacts from other chapters, or activities may be reported under the wrong unit — both of which are GDPR risks and Bufdir reporting errors. This is especially critical for NHF with its complex multi-chapter membership model.
Components
- Unit Assignment Panel ui
- Unit Assignment Service service
- Unit Assignment Repository data
- Access Scope Service service
- RLS Policy Manager infrastructure
- Hierarchy Admin Portal Screen ui