From 3b4c437d1499493747098870ae646649330d0be0 Mon Sep 17 00:00:00 2001 From: Alex T <79433869+hereAlexT@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:47:08 +1100 Subject: [PATCH] upload storage policy --- .../20231206094546_storage_policy.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 backend/supabase/migrations/20231206094546_storage_policy.sql diff --git a/backend/supabase/migrations/20231206094546_storage_policy.sql b/backend/supabase/migrations/20231206094546_storage_policy.sql new file mode 100644 index 0000000..ccc455c --- /dev/null +++ b/backend/supabase/migrations/20231206094546_storage_policy.sql @@ -0,0 +1,25 @@ +create policy "Give users access to own folder twar1h_0" +on "storage"."objects" +as permissive +for select +to authenticated +using (((bucket_id = 'note_images'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))); + + +create policy "Give users access to own folder twar1h_1" +on "storage"."objects" +as permissive +for insert +to authenticated +with check (((bucket_id = 'note_images'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))); + + +create policy "Give users access to own folder twar1h_2" +on "storage"."objects" +as permissive +for delete +to authenticated +using (((bucket_id = 'note_images'::text) AND ((auth.uid())::text = (storage.foldername(name))[1]))); + + +