Trouble with RLS and a custom authorize function
I have the following function defined to use as an authorization method in my RLS policies:
In the
In the
Calling the
Does anyone have any idea what's going wrong here?
In the
roles_permissions table I have added a single permission: project.view for a role owner.In the
projects_users table I have a row with project_id, profile_id, and role.Calling the
authorize function manually works fine and returns true as I would expect. However, the RLS policy never passes. The projects table has a SELECT policy defined as authorize('projects.view'::app_permission, uid(), id).Does anyone have any idea what's going wrong here?