Hello I am trying to run a database function which takes in a user_id and a permission code as parameters and return true if the user has the permission. The function works as expected in the SQL editor. But when calling the function via BASH it only works as expected when using the Service Key. When providing the exact same parameters and using the ANON_KEY it returns false (but should be returning true).
I suspect this is also why, when providing the function in the RLS policy USING expression it just isn't working (because it is returning false)
I have also posted the fucntion and I have tried using UUID directly in the parameters.