@everyone
Hello,
I have a function that is being triggered on document creation, the goal of which is to update the underlying permissions of the document. I am able to get the user id of the document creator from the event payload, but when I try to read the user's membership data as follows:
let userMemberships = await users.listMemberships( userId );
The api key that the function is using has the required user.read access assigned to it (it has ALL the access).
I've tried userId formatted as "63e281f5412926a9296b" as well as "user:63e281f5412926a9296b"
When wrapping it all in a loop, I get an empty array as the error when the code goes to the catch, when not wrapping in a loop I get the attached in the Error tab of the execution.
In the Raw data pop out I see more info (attached as well), but it seems the User (role: guests) missing scope (functions.read) is the core issue (no clue it could be a rat hole).
I'm not sure where I would set that, if that is even the issue. From my sleuthing, it seems that similar messages occur when the user is anonymous. But there is no user and the api key has full perms. I've tried it with setSelfSigned set to true when initializing the client (and without it, its not in the sample code in the documentation).
Thanks for any help.