mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-08 19:52:50 +02:00
Update:Authors page check user can access library items and can edit
This commit is contained in:
@@ -379,13 +379,8 @@ class LibraryItemController {
|
||||
var item = this.db.libraryItems.find(li => li.id === req.params.id)
|
||||
if (!item || !item.media) return res.sendStatus(404)
|
||||
|
||||
// Check user can access this library
|
||||
if (!req.user.checkCanAccessLibrary(item.libraryId)) {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
// Check user can access this library item
|
||||
if (!req.user.checkCanAccessLibraryItemWithTags(item.media.tags)) {
|
||||
if (!req.user.checkCanAccessLibraryItem(item)) {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user