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
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...
- Cloud function deploy stucks in processi...
Been trying for the last hours to deploy my function but for whatever reason, alwasy stuck on processing!
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...