I have a policy that uses a function for the USING and its working as intended, however the response from the policy is a 404 since technically it doesnt find a matching record in the function. How do I get the RLS error to bubble up to the database query instead of just returning a 404?
create policy "Products can only be updated by a shop admin or moderator" ON public.products for UPDATE USING ( user_belongs_to_shop(auth.uid(), shop_id) AND ( shop_user_has_role(auth.uid(), 'ADMIN'::user_shops_roles, id) OR shop_user_has_role(auth.uid(), 'MODERATOR'::user_shops_roles, id) ) );
create policy "Products can only be updated by a shop admin or moderator" ON public.products for UPDATE USING ( user_belongs_to_shop(auth.uid(), shop_id) AND ( shop_user_has_role(auth.uid(), 'ADMIN'::user_shops_roles, id) OR shop_user_has_role(auth.uid(), 'MODERATOR'::user_shops_roles, id) ) );
When I try to make an update that'll return false for the USING I get the following -->
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.