
I've got a collection called movie_guilelisted
which allow to user to recommend to another user a movie. Inside each document we got a movieId
, userId
(the user target) and by
which is the user who recommend the movie. The by
attribut is a relationship attribut to my collection users
. The problem rn is if im connected which the user target account, I cant delete the document because there is a relationship attribut which is linked to a different user than the one on which I am connected. So what can I do ?

Hello @loup Does your movie document look something like this? `` { movieId: 'unique_value', userId: 'target_id', by: 'referrer_id' }
``
And you would like to delete this document as a target user?
Can you please share your collection permissions or document security if you have any?


Firstly, ive try to add document security but not working because user can only set permission to him, not to another specific user

Permissions:

can you please share the permissions in the related collection as well?

for the user
collection

ive just made a relationship attribut to get the username of the user who recommend the movie without making a request to get something like this :

Can you try adding delete permission in the users collection and then try out your use case? For now the users should have permission to all the related collections as well to perform any crud operation. We have a fix pending for this bug, once this is merged it should be good https://github.com/appwrite/appwrite/pull/5815

okay thx im gonna add the delete permission

Great, let us know if you're able to delete once you try it out or if you have any more questions

its working rn !

Great!

Thx !

For a more secure way, you can create an appwrite function which should validate permissions before doing any sort of crud operation

[solved] Delete a document containing a relationship's attribute

[SOLVED] Delete a document containing a relationship's attribute
Recommended threads
- Appwrite Fra Cloud Custom Domains Issue
I’m trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
- Appwrite service :: getCurrentUser :: Us...
Getting this error while creating a react app can someone please help me solve the error
- Storage & Database is not allowing.
Storage & Database is not allowing to CRUD after i have logged in ? Using web SDK with next.js without any SSR or node-sdk.
