diff options
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.' }) |