mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
846 B
SQL
26 lines
846 B
SQL
|
|
-- Create arc-files storage bucket
|
|
INSERT INTO storage.buckets (id, name, public)
|
|
VALUES ('arc-files', 'arc-files', true)
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
-- Allow authenticated users to upload
|
|
CREATE POLICY "Authenticated users can upload arc files"
|
|
ON storage.objects FOR INSERT TO authenticated
|
|
WITH CHECK (bucket_id = 'arc-files');
|
|
|
|
-- Allow authenticated users to read
|
|
CREATE POLICY "Authenticated users can read arc files"
|
|
ON storage.objects FOR SELECT TO authenticated
|
|
USING (bucket_id = 'arc-files');
|
|
|
|
-- Allow public read for previews
|
|
CREATE POLICY "Public can read arc files"
|
|
ON storage.objects FOR SELECT TO anon
|
|
USING (bucket_id = 'arc-files');
|
|
|
|
-- Allow authenticated users to delete their uploads
|
|
CREATE POLICY "Authenticated users can delete arc files"
|
|
ON storage.objects FOR DELETE TO authenticated
|
|
USING (bucket_id = 'arc-files');
|