mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-01 13:04:52 +02:00
Fix:Get libraries endpoint return only libraries accessible to user
This commit is contained in:
parent
48921c3150
commit
8442a629fb
1 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,11 @@ class LibraryController {
|
|||
}
|
||||
|
||||
findAll(req, res) {
|
||||
var librariesAccessible = req.user.librariesAccessible || []
|
||||
if (librariesAccessible && librariesAccessible.length) {
|
||||
return res.json(this.db.libraries.filter(lib => librariesAccessible.includes(lib.id)).map(lib => lib.toJSON()))
|
||||
}
|
||||
|
||||
res.json(this.db.libraries.map(lib => lib.toJSON()))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue