-
Hi, I would like to implement a set of RLS policies so that only authenticated users can modify a certain table (no matter which row), but every user (anon too) can be notified by Realtime of every changes made in that table. Is that possible with the new Realtime RLS feature? EDIT: (before it was possible because Realtime didn't have RLS) Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
@ruggi99 just a heads up I replied to your support ticket regarding this issue. We're working hard to update Realtime RLS to incorporate all roles so very soon you can set a select policy like (auth.role() = 'anon') and have this work. |
Beta Was this translation helpful? Give feedback.
-
Maybe stupid question but in the interim couldn't you set the INSERT and UPDATE RLS policies to |
Beta Was this translation helpful? Give feedback.
-
just wanted to give an update that this has been rolled out to Supabase projects. You can include |
Beta Was this translation helpful? Give feedback.
-
i actually ran into this issue a few hours ago. issue #7630 is worth mentioning as it provides context. basically if you want to scope the for reference - to enable RLS and realtime -- enable realtime
begin;
drop publication if exists supabase_realtime;
create publication supabase_realtime with (publish = 'update');
commit;
-- include foo_table
alter publication supabase_realtime add table foo_table;
-- create policies
create policy "anon_foo_table_select_policy"
on public.foo_table
for select
to anon
using (
true
);
create policy "anon_foo_table_update_policy"
on public.foo_table
for update
to anon
using (
true
) with check (
true
); maybe my brain was too fried and overlooked this in the documentation.. just wanted to share. |
Beta Was this translation helpful? Give feedback.
@ruggi99 just a heads up I replied to your support ticket regarding this issue.
We're working hard to update Realtime RLS to incorporate all roles so very soon you can set a select policy like (auth.role() = 'anon') and have this work.