Access Member Overview with Permission-Enforced Organizational Scope
Access to the member overview screen is gated by the Permission Guard service, which validates that the authenticated user holds either the coordinator or organization-administrator role before rendering the screen. If a user without the required role attempts to access this route, they are redirected to the No-Access Screen. Beyond screen-level authorization, the Member Overview Repository constructs all Supabase queries with coordinator-scoped predicates derived from the authenticated user's organizational hierarchy stored in user_organization_memberships. Row-level security policies in Supabase provide a second enforcement layer ensuring that even if client-side guards were bypassed, the backend would return only authorized records.
User Story
Acceptance Criteria
- Given I am authenticated as a peer mentor role, when I attempt to navigate to the member overview route, then I am redirected to the no-access screen
- Given I am authenticated as a coordinator, when the member overview data loads, then the query returns only members belonging to local associations, regions, or national associations within my assigned organizational hierarchy
- Given I am authenticated as an organization administrator, when the member overview data loads, then I see members across all organizational levels within my administrative authority
- Given the Permission Guard validates my role successfully, when the screen renders, then no unauthorized member data from outside my organizational scope is returned by any API call
- Given Supabase RLS policies are active, when a coordinator query executes, then the database-level policy independently enforces organizational scoping even if service-layer filtering were absent
Business Value
Member management screens expose sensitive volunteer data including contact details, availability, and assignment history. Unauthorized access would violate GDPR obligations and organizational trust. Defense-in-depth enforcement — client-side guards plus server-side RLS — ensures data is protected even against implementation errors, which is a non-negotiable requirement for handling personal data under Norwegian privacy law.
Components
- Member Overview Screen ui
- Coordinator Overview Service service
- Member Overview Repository data
- Permission Guard service
- Role Authorization Service service