
I'm working with function, which should generate a document in Collection B, but only if user who's calling the function, is the owner of Document in Collection A.
Function is getting documentId
as parameter through request body, but I'm wondering how can I access which user is making the actual function call, since I should fetch the documentId
document from Collection A, and compare if caller matched documentA.ownerId
field.
I'm excecuting the function through node-appwrite
sessionClient, so call is made as logged in user, and actual call permission is checked by Functions own excecution access.

You can get the authenticated user id with
const userId = req.headers['x-appwrite-user-id'];
Recommended threads
- Issue with Appwrite Function Execution ā...
Hi all, I'm encountering an issue when calling an Appwrite function from my Flutter app. **Environment:** ```Flutter SDK: 3.27.3 Appwrite Flutter SDK: 16.1.0```...
- Steps to Enable HTTP Access to appwrite ...
Hi Appwrite team, I have created a function and I want it to receive and incoming post request from a webhook( a webhook that notifies the function to update t...
- Unable to Access Appwrite Console & API ...
I have been unable to access my Appwrite console and related services for the past two weeks. Additionally, the Appwrite integration on my production website ha...
