how to insert RLS to inser a group member? #26646
-
I have a table name group_members like this: field meaning : here is my question: I try some policy like this: AS PERMISSIVE FOR INSERT TO PUBLIC WITH CHECK (
); but some error occur: Failed to update database policy: undefined so, how can I write the correct RLS policy? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
You show doing create policy then have create policy again. You only do that once. Where are you entering this? |
Beta Was this translation helpful? Give feedback.
-
sorry! here is my definer funtion: ` and for select policy: create policy "query by auth uid" on "public"."tb_group_members" as permissive for select to authenticated using ( ` |
Beta Was this translation helpful? Give feedback.
That would only work for insert. For select policy I assumed you were not limiting it. You can't do a select on the table itself in hte select policy without moving all the of the select code to a security definer function. It will keep calling itself over and over.