Add ACMCC app source, Supabase backend, and project config

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 20:19:26 -04:00
parent 313b51b412
commit 183fe0a93c
1422 changed files with 259271 additions and 0 deletions
@@ -0,0 +1,25 @@
-- Fix SELECT: staff see all, others see only their associations
DROP POLICY IF EXISTS "Authenticated users can read active announcements" ON public.announcements;
CREATE POLICY "Authenticated users can read scoped announcements" ON public.announcements
FOR SELECT TO authenticated
USING (
status = 'active' AND (
public.has_role(auth.uid(), 'admin') OR
public.has_role(auth.uid(), 'manager') OR
public.has_role(auth.uid(), 'employee') OR
association_id IN (SELECT public.get_user_association_ids())
)
);
-- Fix UPDATE: restrict to staff
DROP POLICY IF EXISTS "Authors can update their announcements" ON public.announcements;
CREATE POLICY "Staff can update announcements" ON public.announcements
FOR UPDATE TO authenticated
USING (public.has_role(auth.uid(), 'admin') OR public.has_role(auth.uid(), 'manager'));
-- Fix DELETE: restrict to staff
DROP POLICY IF EXISTS "Authors can delete their announcements" ON public.announcements;
CREATE POLICY "Staff can delete announcements" ON public.announcements
FOR DELETE TO authenticated
USING (public.has_role(auth.uid(), 'admin') OR public.has_role(auth.uid(), 'manager'));