https://supabase.com/ logo
using the policy editor for RLS, how can i add a W...
# help
g
using the policy editor for RLS, how can i add a WITH CHECK clause? putting
Copy code
auth.uid() = user_uid
WITH CHECK (true)
into the expression box results in the WITH CHECK statement being wrapped up in the USING statement
USING (auth.uid() = user_uid WITH CHECK (true))
almost seems like a WITH CHECK box should be added under the expression box as anything in the expression box is just added to the USING clause..
n
Hello @gorbypark! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
of course I could just use plain SQL to do it, but it's kinda nice using the editor 😄
ooh, interesting, if using a template with an WITH CHECK clause, after clicking use template, there's actually a box for a check expression, but there's non in the "create a policy from scratch" editor. Odd.
Ah, the with check box is only available on UPDATE (or ALL) statements.
which makes sense.
n
Thread was archived by @gorbypark. Anyone can send a message to unarchive it.