Open3

Supabase で anon の全権を奪った後、選択的に権限を付与する

プログラミングをするパンダプログラミングをするパンダ

上記の事象を回避するために、grant でテーブルごとに権限を付与する。

alter table profiles enable row level security;

create policy "Public profiles are viewable by everyone."
  on profiles for select using ( true );

-- 選択的に権限を追加
grant select on profiles to "anon";

これで RLS の設定ミスによるセキュリティインシデントの発生パターンを減らせる。

https://www.dbonline.jp/postgresql/role/index3.html