aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-28 09:50:27 +0200
committerChocobozzz <me@florianbigard.com>2019-05-28 09:50:27 +0200
commit964298de4e112df0e126aad755c6b077442a2821 (patch)
tree99a77835b7db55bf89b670d7739084b3e31365c8 /server/middlewares
parentff0bce13592da002a836caedf8daebcdd035260c (diff)
downloadPeerTube-964298de4e112df0e126aad755c6b077442a2821.tar.gz
PeerTube-964298de4e112df0e126aad755c6b077442a2821.tar.zst
PeerTube-964298de4e112df0e126aad755c6b077442a2821.zip
Fix playlist get for classic users
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/videos/video-playlists.ts3
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.' })