(SELECT auth.role() AS user_role) = 'authenticated'
(SELECT auth.role() AS user_role) = 'authenticated'
inside a scoped policy redundant? I could of sworn someone in the past had told me this was some sort of belt and suspenders, maybe was a fever dream. Something like this:
CREATE POLICY orders_select_allON public.ordersFOR SELECTTO authenticatedUSING ( (SELECT auth.role() AS user_role) = 'authenticated' AND (SELECT public.authorize('TABLE_ORDERS_SELECT_ALL') AS is_authorized));
CREATE POLICY orders_select_allON public.ordersFOR SELECTTO authenticatedUSING ( (SELECT auth.role() AS user_role) = 'authenticated' AND (SELECT public.authorize('TABLE_ORDERS_SELECT_ALL') AS is_authorized));
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.