Is role() a function defined in the auth schema? As far as I know the auth schema on Supabase will only have auth.uid() defined by default. You could try auth.uid() is not null as your indicator that the user is authenticated. Or instead of defining it as a policy for 'public' define it for 'authenticated'