Check perms in list views

This commit is contained in:
Mouse Reeve
2021-09-27 14:03:06 -07:00
parent ab31798931
commit 556ae0726b
2 changed files with 36 additions and 34 deletions

View File

@ -92,6 +92,12 @@ class ListItem(CollectionItemMixin, BookWyrmModel):
notification_type="ADD",
)
def raise_not_deletable(self, viewer):
"""the associated user OR the list owner can delete"""
if self.book_list.user == viewer:
return
super().raise_not_deletable(viewer)
class Meta:
"""A book may only be placed into a list once,
and each order in the list may be used only once"""