HIGH story-supabase-backend-core-global-admin-008 5 pts
5
Story Points
High
Priority
Supabase Backend Core
Feature

User Story

As a Global Administrator
I want to configure Supabase Storage buckets with appropriate access policies for receipts, documents, and certificates
So that So that uploaded files are stored securely with access limited to the uploading user and authorized coordinators, preventing unauthorized file access across organizations

Acceptance Criteria

  • Given a peer mentor uploads an expense receipt, when another peer mentor from the same organization attempts to access the file URL, then access is denied with a 403 response
  • Given a coordinator accesses their organization's receipt storage bucket, when listing files, then only receipts from peer mentors in their organization are visible
  • Given the admin configures a bucket for encrypted assignment documents, when the bucket policy is reviewed, then direct public access is disabled and access requires a valid JWT
  • Given file size limits are configured per bucket type, when a user attempts to upload an oversized file, then a clear error message is returned before the upload completes
  • Given the admin reviews storage usage, when viewing Supabase Storage metrics, then usage per bucket and per organization is visible for capacity planning

Business Value

Secure file storage is required for GDPR compliance. The platform handles sensitive document types including health-related epikrise references (Blindeforbundet), NDA agreements for drivers, and power-of-attorney documents. Misconfigured storage policies could allow cross-user or cross-organization file access, constituting a personal data breach under GDPR Article 4(12). Correct bucket policies provide the storage-layer equivalent of database RLS.

Components