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 bywhich 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 usercollection
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
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Hi Folks, Database Writing Issue
Hey Folks im trying to get logging setup on my website but im getting an error, i dont have any document id and i think this is the issue but i havent got the f...
- Middleware
how to make middleware in nextjs appwrite with client side auth?