질문해결됨목업
Supabase RLS 설정하다가 막혔어요. 로그인한 사람만 쓰게 하려면?
@newbie.j · 4시간 전
로그인한 사람만 글을 쓰게 하고 싶은데, 아래처럼 정책을 넣었더니 아무도 못 써요.
sql
create policy "글쓰기" on posts for insert with check (true);뭘 빠뜨린 걸까요?
@newbie.j · 4시간 전
로그인한 사람만 글을 쓰게 하고 싶은데, 아래처럼 정책을 넣었더니 아무도 못 써요.
create policy "글쓰기" on posts for insert with check (true);뭘 빠뜨린 걸까요?
with check (true) 는 모두 허용이라, 보통은 RLS 를 켜고 to authenticated 를 주는 것이 빠져서 그래요.
alter table posts enable row level security;
create policy "글쓰기" on posts for insert to authenticated
with check (author_id = auth.uid());답글 2
답글 3
답글 4
답글 5
답글 6
답글 7
답글 8
답글 9
답글 10
답글 11