diff --git a/client/components/tables/collection/BookTableRow.vue b/client/components/tables/collection/BookTableRow.vue index 1aa0b4eb1..72aca8e1d 100644 --- a/client/components/tables/collection/BookTableRow.vue +++ b/client/components/tables/collection/BookTableRow.vue @@ -42,7 +42,7 @@
-
+
@@ -79,8 +79,7 @@ export default { }, computed: { translateDistance() { - if (!this.userCanUpdate && !this.userCanDelete) return 'translate-x-0' - else if (!this.userCanUpdate || !this.userCanDelete) return '-translate-x-12' + if (!this.userCanUpdate) return 'translate-x-0' return '-translate-x-24' }, media() { @@ -144,9 +143,6 @@ export default { }, userCanUpdate() { return this.$store.getters['user/getUserCanUpdate'] - }, - userCanDelete() { - return this.$store.getters['user/getUserCanDelete'] } }, methods: { diff --git a/server/controllers/CollectionController.js b/server/controllers/CollectionController.js index f01ce6664..7be0c5f57 100644 --- a/server/controllers/CollectionController.js +++ b/server/controllers/CollectionController.js @@ -446,7 +446,7 @@ class CollectionController { if (req.method == 'DELETE' && !req.params.bookId && !req.user.canDelete) { Logger.warn(`[CollectionController] User "${req.user.username}" attempted to delete without permission`) return res.sendStatus(403) - } else if ((req.method == 'PATCH' || req.method == 'POST') && !req.user.canUpdate) { + } else if ((req.method == 'PATCH' || req.method == 'POST' || (req.method == 'DELETE' && req.params.bookId)) && !req.user.canUpdate) { Logger.warn(`[CollectionController] User "${req.user.username}" attempted to update without permission`) return res.sendStatus(403) }