mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Fix:Get libraries endpoint return only libraries accessible to user
This commit is contained in:
parent
48921c3150
commit
8442a629fb
@ -29,6 +29,11 @@ class LibraryController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
findAll(req, res) {
|
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()))
|
res.json(this.db.libraries.map(lib => lib.toJSON()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user