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,24 @@
|
||||
|
||||
-- Create avatars storage bucket
|
||||
INSERT INTO storage.buckets (id, name, public) VALUES ('avatars', 'avatars', true)
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
|
||||
-- Allow authenticated users to upload their own avatar
|
||||
CREATE POLICY "Users can upload own avatar"
|
||||
ON storage.objects FOR INSERT TO authenticated
|
||||
WITH CHECK (bucket_id = 'avatars' AND (storage.foldername(name))[1] = auth.uid()::text);
|
||||
|
||||
-- Allow authenticated users to update their own avatar
|
||||
CREATE POLICY "Users can update own avatar"
|
||||
ON storage.objects FOR UPDATE TO authenticated
|
||||
USING (bucket_id = 'avatars' AND (storage.foldername(name))[1] = auth.uid()::text);
|
||||
|
||||
-- Allow authenticated users to delete their own avatar
|
||||
CREATE POLICY "Users can delete own avatar"
|
||||
ON storage.objects FOR DELETE TO authenticated
|
||||
USING (bucket_id = 'avatars' AND (storage.foldername(name))[1] = auth.uid()::text);
|
||||
|
||||
-- Allow public read access to avatars
|
||||
CREATE POLICY "Public read access for avatars"
|
||||
ON storage.objects FOR SELECT TO public
|
||||
USING (bucket_id = 'avatars');
|
||||
Reference in New Issue
Block a user