CRITICAL story-geographic-matching-coordinator-008 3 pts
3
Story Points
Critical
Priority
Geographic Matching & Map View
Feature

User Story

As a Coordinator
I want the map view to be accessible only to users with the coordinator role, with peer mentors unable to access location data for other mentors
So that So that sensitive location data about peer mentors is protected from unauthorised access and only those with a legitimate coordination need can view geographic distributions

Acceptance Criteria

  • Given I am authenticated with a peer mentor role, when I attempt to navigate to the map view route, then I am redirected to the No-Access Screen and no location data is returned from the API
  • Given I am authenticated as a coordinator, when I open the map view, then only mentor location pins within my own organisational scope are visible
  • Given I am authenticated as a coordinator in Organisation A, when I view the map, then I cannot see pins for mentors belonging to Organisation B
  • Given an unauthenticated user attempts to access the map API endpoint directly, when the request is processed by Supabase RLS, then the response returns zero rows and no location data is exposed

Business Value

Protecting location data from unauthorised access is both a GDPR obligation and a prerequisite for peer mentor trust. If mentors suspected their location was visible to other mentors or the general public, they would decline consent en masse, rendering the entire geographic matching feature non-functional. Dual enforcement via app-level role guards and database-level RLS policies provides defence in depth.