First draft of calendar deletion

This commit is contained in:
Alexis
2024-08-25 00:35:24 +02:00
parent feb04912ca
commit 07e97873ef
6 changed files with 176 additions and 16 deletions

View File

@@ -175,19 +175,25 @@ create policy "Allow individual insert access for GMs" on public.worlds for inse
create policy "Allow individual update access for GMs" on public.worlds for update using ( auth.uid() = gm_id );
-- Calendar policies
create policy "Allow individual read access for GMs" on public.calendars for select using (
create policy "Allow GMs to see their calendars" on public.calendars for select using (
exists (
select 1 from worlds
where worlds.id = calendars.world_id
)
);
create policy "Allow individual insert access for GMs" on public.calendars for insert with check (
create policy "Allow GMs to add calendars to their worldd" on public.calendars for insert with check (
exists (
select 1 from worlds
where worlds.id = calendars.world_id
)
);
create policy "Allow individual update access for GMs" on public.calendars for update with check (
create policy "Allow GMs to edit their calendars" on public.calendars for update with check (
exists (
select 1 from worlds
where worlds.id = calendars.world_id
)
);
create policy "Allow GMs to delete their calendars" on public.calendars for delete using (
exists (
select 1 from worlds
where worlds.id = calendars.world_id