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,39 @@
|
||||
-- Allow any authenticated user to insert their own comments
|
||||
CREATE POLICY "Authenticated users can insert own entity_comments"
|
||||
ON public.entity_comments
|
||||
FOR INSERT
|
||||
TO authenticated
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
-- Allow any authenticated user to insert their own votes
|
||||
CREATE POLICY "Authenticated users can insert own entity_votes"
|
||||
ON public.entity_votes
|
||||
FOR INSERT
|
||||
TO authenticated
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
-- Allow any authenticated user to update their own votes
|
||||
CREATE POLICY "Authenticated users can update own entity_votes"
|
||||
ON public.entity_votes
|
||||
FOR UPDATE
|
||||
TO authenticated
|
||||
USING (auth.uid() = user_id)
|
||||
WITH CHECK (auth.uid() = user_id);
|
||||
|
||||
-- Allow any authenticated user to delete their own votes
|
||||
CREATE POLICY "Authenticated users can delete own entity_votes"
|
||||
ON public.entity_votes
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
-- Allow any authenticated user to delete their own comments
|
||||
CREATE POLICY "Authenticated users can delete own entity_comments"
|
||||
ON public.entity_comments
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (auth.uid() = user_id);
|
||||
|
||||
-- Enable realtime for both tables
|
||||
ALTER PUBLICATION supabase_realtime ADD TABLE public.entity_votes;
|
||||
ALTER PUBLICATION supabase_realtime ADD TABLE public.entity_comments;
|
||||
Reference in New Issue
Block a user