mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-24 17:59:06 +02:00
Add:Restrict user permissions by tag
This commit is contained in:
parent
f8d0384155
commit
27f1bd90f9
6 changed files with 114 additions and 11 deletions
|
@ -233,7 +233,9 @@ class LibraryController {
|
|||
if (!req.params.series) {
|
||||
return res.status(403).send('Invalid series')
|
||||
}
|
||||
var libraryItems = this.db.libraryItems.filter(li => li.libraryId === req.library.id && li.book.series === req.params.series)
|
||||
var libraryItems = this.db.libraryItems.filter(li => {
|
||||
return li.libraryId === req.library.id && li.book.series === req.params.series
|
||||
})
|
||||
if (!libraryItems.length) {
|
||||
return res.status(404).send('Series not found')
|
||||
}
|
||||
|
@ -530,7 +532,9 @@ class LibraryController {
|
|||
return res.status(404).send('Library not found')
|
||||
}
|
||||
req.library = library
|
||||
req.libraryItems = this.db.libraryItems.filter(li => li.libraryId === library.id)
|
||||
req.libraryItems = this.db.libraryItems.filter(li => {
|
||||
return li.libraryId === library.id && req.user.checkCanAccessLibraryItemWithTags(li.media.tags)
|
||||
})
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue