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>
28 lines
933 B
SQL
28 lines
933 B
SQL
|
|
-- Create public bucket for embedded announcement images
|
|
INSERT INTO storage.buckets (id, name, public)
|
|
VALUES ('announcement-images', 'announcement-images', true)
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
-- Public read for embedded images
|
|
CREATE POLICY "Announcement images publicly readable"
|
|
ON storage.objects FOR SELECT
|
|
USING (bucket_id = 'announcement-images');
|
|
|
|
-- Authenticated users can upload announcement images
|
|
CREATE POLICY "Authenticated can upload announcement images"
|
|
ON storage.objects FOR INSERT
|
|
TO authenticated
|
|
WITH CHECK (bucket_id = 'announcement-images');
|
|
|
|
-- Authenticated users can update/delete announcement images
|
|
CREATE POLICY "Authenticated can update announcement images"
|
|
ON storage.objects FOR UPDATE
|
|
TO authenticated
|
|
USING (bucket_id = 'announcement-images');
|
|
|
|
CREATE POLICY "Authenticated can delete announcement images"
|
|
ON storage.objects FOR DELETE
|
|
TO authenticated
|
|
USING (bucket_id = 'announcement-images');
|