Created
April 6, 2025 15:15
-
-
Save alifma/f32fba70c872abc2aabfc6b423ecae30 to your computer and use it in GitHub Desktop.
SUPABASE Storage RLS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Enable row-level security | |
ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY; | |
-- Policy for SELECT operations | |
CREATE POLICY objects_select_policy ON storage.objects FOR SELECT | |
USING (auth.role() = 'authenticated'); | |
-- Policy for INSERT operations WITH CHECK ! | |
CREATE POLICY objects_insert_policy ON storage.objects FOR INSERT | |
WITH CHECK (auth.role() = 'authenticated'); | |
-- Policy for UPDATE operations | |
CREATE POLICY objects_update_policy ON storage.objects FOR UPDATE | |
USING (auth.role() = 'authenticated'); | |
-- Policy for DELETE operations | |
CREATE POLICY objects_delete_policy ON storage.objects FOR DELETE | |
USING (auth.role() = 'authenticated'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment