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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...