Skip to content

Instantly share code, notes, and snippets.

@alifma
Created April 6, 2025 15:15
Show Gist options
  • Save alifma/f32fba70c872abc2aabfc6b423ecae30 to your computer and use it in GitHub Desktop.
Save alifma/f32fba70c872abc2aabfc6b423ecae30 to your computer and use it in GitHub Desktop.
SUPABASE Storage RLS
-- 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