diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
commit | 0aa52e170727ac6bdf441bcaa2353ae0b8a354ed (patch) | |
tree | 52fa047cf9970590cab1dcc7a3e5caa8eb004171 /server/middlewares | |
parent | ff2cac9fa361a3c5489078f441ed54230c045971 (diff) | |
download | PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.gz PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.zst PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.zip |
Add ability to display all channel/account videos
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index ff90e347a..efab67a01 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -429,7 +429,10 @@ const commonVideosFiltersValidator = [ | |||
429 | if (areValidationErrors(req, res)) return | 429 | if (areValidationErrors(req, res)) return |
430 | 430 | ||
431 | const user = res.locals.oauth ? res.locals.oauth.token.User : undefined | 431 | const user = res.locals.oauth ? res.locals.oauth.token.User : undefined |
432 | if (req.query.filter === 'all-local' && (!user || user.hasRight(UserRight.SEE_ALL_VIDEOS) === false)) { | 432 | if ( |
433 | (req.query.filter === 'all-local' || req.query.filter === 'all') && | ||
434 | (!user || user.hasRight(UserRight.SEE_ALL_VIDEOS) === false) | ||
435 | ) { | ||
433 | res.status(401) | 436 | res.status(401) |
434 | .json({ error: 'You are not allowed to see all local videos.' }) | 437 | .json({ error: 'You are not allowed to see all local videos.' }) |
435 | 438 | ||