mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-01 04:34:07 +01:00
Add user library access check in series controller middleware
This commit is contained in:
1 parent
1c082182b8
commit
ebd03c9086
1 file changed
+4
@@ -95,6 +95,10 @@ class SeriesController {
|
||||
async middleware(req, res, next) {
|
||||
const series = await Database.seriesModel.findByPk(req.params.id)
|
||||
if (!series) return res.sendStatus(404)
|
||||
if (!req.user.checkCanAccessLibrary(series.libraryId)) {
|
||||
Logger.warn(`[SeriesController] User "${req.user.username}" attempted to access series "${series.id}" without access to the library`)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter out any library items not accessible to user
|
||||
|
||||
Reference in new issue
Block a user