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.
The raw data pop out is actually bugged so I wouldn't look at that. It'd actually be helpful if you create an issue for the pop out.
Error: getaddrinfo EAI_AGAIN hostname
As for the error, you're getting that because client.setEndpoint()
is not being called with your Appwrite endpoint.
Recommended threads
- Trying to Figure out how to delete a use...
If i have a button in an app that allows a user to delete their account, can I not just call a function from my swift app to Appwrite to have the account delete...
- Expected a value of type 'bool', but got...
I am trying to get current User, but get this error message when I do. I get back user prefs, but error comes from trying account.get() So I am getting User. I ...
- Problem accessing api via local host.
I think i set the Endpoint correctly in my config.ts als the cloud.appwrite url but when i try to create a user I get this Error message: Access to XMLHttpReque...