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?