From eca11ae69601121aab376b37d45eb866e6b8d92d Mon Sep 17 00:00:00 2001 From: h8570rg Date: Tue, 17 Sep 2024 22:40:48 +0900 Subject: [PATCH] fix: policy --- supabase/migrations/20240917134035_local.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 supabase/migrations/20240917134035_local.sql diff --git a/supabase/migrations/20240917134035_local.sql b/supabase/migrations/20240917134035_local.sql new file mode 100644 index 0000000..49713b7 --- /dev/null +++ b/supabase/migrations/20240917134035_local.sql @@ -0,0 +1,13 @@ +drop policy "Authenticated users can select matches" on "public"."matches"; + +create policy "Authenticated users can select matches" +on "public"."matches" +as permissive +for select +to authenticated +using (((EXISTS ( SELECT 1 + FROM match_players + WHERE ((match_players.match_id = matches.id) AND (match_players.player_id = auth.uid())))) OR (created_by = auth.uid()))); + + +