Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16420

Supabase RLS to check the 'users' table's 'owner' column using auth.uid() but it returns syntax error

$
0
0
CREATE POLICY "Allow admin access to test table." ON test FOR ALL TO auth.uid()WHERE  (    SELECT      ADMIN    FROM      users    WHERE      users.owner = auth.uid() //auth.uid() = users.owner <--- tried this too  );

This causes

ERROR:  syntax error at or near "."LINE 1: CREATE POLICY "Allow admin access to z_test table." ON z_test FOR ALL TO auth.uid ()

How can I allow users to do all when 'users' table's column 'onwers' return TRUE?


Viewing all articles
Browse latest Browse all 16420

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>