mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-22 00:21:36 +01:00
Update remove book from collection endpoint to require Can Update permission instead of Can Delete
This commit is contained in:
1 parent
3e0333877b
commit
75d85e971b
2 files changed
+3
-7
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user