diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-28 09:50:27 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-28 10:16:59 +0200 |
commit | 4d09cfba7820544e72f04bf83c680bc24b775358 (patch) | |
tree | a4b4993ee3886658376c83648043442225fcd139 /server/middlewares | |
parent | ec893ae07554e37ba4e04773b346b5b80e71e152 (diff) | |
download | PeerTube-4d09cfba7820544e72f04bf83c680bc24b775358.tar.gz PeerTube-4d09cfba7820544e72f04bf83c680bc24b775358.tar.zst PeerTube-4d09cfba7820544e72f04bf83c680bc24b775358.zip |
Fix playlist get for classic users
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/videos/video-playlists.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 2c3f7e542..f68eeeeb3 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts | |||
@@ -140,9 +140,10 @@ const videoPlaylistsGetValidator = [ | |||
140 | await authenticatePromiseIfNeeded(req, res) | 140 | await authenticatePromiseIfNeeded(req, res) |
141 | 141 | ||
142 | const user = res.locals.oauth ? res.locals.oauth.token.User : null | 142 | const user = res.locals.oauth ? res.locals.oauth.token.User : null |
143 | |||
143 | if ( | 144 | if ( |
144 | !user || | 145 | !user || |
145 | (videoPlaylist.OwnerAccount.userId !== user.id && !user.hasRight(UserRight.UPDATE_ANY_VIDEO_PLAYLIST)) | 146 | (videoPlaylist.OwnerAccount.id !== user.Account.id && !user.hasRight(UserRight.UPDATE_ANY_VIDEO_PLAYLIST)) |
146 | ) { | 147 | ) { |
147 | return res.status(403) | 148 | return res.status(403) |
148 | .json({ error: 'Cannot get this private video playlist.' }) | 149 | .json({ error: 'Cannot get this private video playlist.' }) |