Fix SECURITY DEFINER on views

This commit is contained in:
gpt-engineer-app[bot]
2025-10-12 14:07:12 +00:00
parent 846c8ec7c0
commit 21ba87a664

View File

@@ -0,0 +1,5 @@
-- Set filtered_profiles view to use security_invoker
-- This makes the view execute with the permissions of the invoking user, not the creator
ALTER VIEW public.filtered_profiles SET (security_invoker = true);
COMMENT ON VIEW public.filtered_profiles IS 'Profile view with field-level privacy controls using security_invoker. Uses security definer functions for granular permission checks but view respects querying user context.';