From 4d09cfba7820544e72f04bf83c680bc24b775358 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 May 2019 09:50:27 +0200 Subject: Fix playlist get for classic users --- server/middlewares/validators/videos/video-playlists.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/middlewares') 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 = [ await authenticatePromiseIfNeeded(req, res) const user = res.locals.oauth ? res.locals.oauth.token.User : null + if ( !user || - (videoPlaylist.OwnerAccount.userId !== user.id && !user.hasRight(UserRight.UPDATE_ANY_VIDEO_PLAYLIST)) + (videoPlaylist.OwnerAccount.id !== user.Account.id && !user.hasRight(UserRight.UPDATE_ANY_VIDEO_PLAYLIST)) ) { return res.status(403) .json({ error: 'Cannot get this private video playlist.' }) -- cgit v1.2.3