Spaces:
Sleeping
Sleeping
Commit History
-
fix(admin): make admin authorization per-organization, not one flat global list
Donne120 +1: Claude Sonnet 5Real gap found while designing per-university curator management: the existing admin authorization had two problems that made it unsafe for a real second university, not just cosmetically single-tenant. 1. admin_routes.py's current_org/current_org_read still checked the Phase-1-hardcoded ALLOWED_DOMAINS tuple directly, never updated when auth.py's require_user was fixed to use the real Aurora lookup. A second university's admin would be rejected with "ALU email required" regardless of ADMIN_EMAILS membership — this route was never actually reachable by any admin outside the original two ALU domains. 2. ADMIN_EMAILS was one flat, global env var with no organization attached to any entry. current_org derived the admin's org purely from their OWN email domain — which happens to be safe against cross-tenant access (an admin can't reach an org other than their own domain's) but gives no structural way to manage two universities' admin lists independently, rev…a9f393f