
Hello everyone, I have a collection called innocaps and each document has an attribute called "owner". I am using Appwrite function with PHP SDK to delete an innocap document and what I'm trying to accomplish is to set up permissions in such a way that only the owner of a document can delete that specific document and other users should not have that ability. I've been reading through the Appwrite documentation, but I'm not entirely sure how to implement this specific permission logic. Can someone please guide me on the steps to achieve this?

Hi @sidney by default appwrite the current user is granted with all permissions, that means if you don't send any permission when you create the document, the person who create the document can read, update, and delete the document:
You can check that in the documentation of createDocument
https://appwrite.io/docs/client/databases?sdk=web-default#databasesCreateDocument

I created a function to delete a document and I have to add the permission only for the owner to delete it, but in this documentation: https://appwrite.io/docs/server/databases?sdk=php-default#databasesDeleteDocument I don't see permission in http request

You don't set the permissions in the deleteDocument
, you do it in createDocument
or updateDocument

What is a reason of that because I don't want that other users can be able to delete the document of the owner

you send it as part of the create and update so that it's in the document itself. So, when the delete is executed, Appwrite can look at the document to see who should have access and then validate against who made the request
Recommended threads
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Forever Processing Issue
I encountered an issue when creating attributes in the collections . if you create an attribute of type string for example and choose a size of 200 or 250 or a...
