mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
Add ACMCC app source, Supabase backend, and project config
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
|
||||
-- Fix anon SELECT: restrict to rows matching a vote_token or access_code filter
|
||||
DROP POLICY IF EXISTS "Anon can select own voter record by token" ON public.election_eligible_voters;
|
||||
CREATE POLICY "Anon can select own voter record by token" ON public.election_eligible_voters
|
||||
FOR SELECT TO anon
|
||||
USING (
|
||||
vote_token::text = current_setting('request.headers', true)::json->>'x-vote-token'
|
||||
OR access_code = current_setting('request.headers', true)::json->>'x-access-code'
|
||||
);
|
||||
|
||||
-- Fix anon UPDATE: restrict to rows matching vote_token filter
|
||||
DROP POLICY IF EXISTS "Anon can update voted status by token" ON public.election_eligible_voters;
|
||||
CREATE POLICY "Anon can update voted status by token" ON public.election_eligible_voters
|
||||
FOR UPDATE TO anon
|
||||
USING (
|
||||
vote_token::text = current_setting('request.headers', true)::json->>'x-vote-token'
|
||||
)
|
||||
WITH CHECK (
|
||||
vote_token::text = current_setting('request.headers', true)::json->>'x-vote-token'
|
||||
);
|
||||
Reference in New Issue
Block a user