Here is my firebase data structure:
item:
itemUID:
Title: ""
createdBy: userUID
media:
mediaUID:
Title: ""
createdBy: userUID
items:
itemUID: true
itemUID: true
user:
userUID:
firstname: ""
lastname: ""
I would like the current user to edit one of their media lists. the media is basically a bunch of items and a title and who the media was created by, which is the current user. Other users can add the current user's items to their media and a reference to that item appears in "items" in the media. When the current user edits their media and wants to delete an item from the media, I would like to only delete the item if
- it was created by the current user
- it is not in anyone else's media
how would I go about doing this in swift? Thank you