From 46a6db245f50249246325090eeaffd165453a396 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Jun 2019 16:44:02 +0200 Subject: Add ability to set to private a public/unlisted video --- server/middlewares/validators/videos/videos.ts | 8 -------- 1 file changed, 8 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 2b01f108d..b1c05ab2d 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -111,18 +111,10 @@ const videosUpdateValidator = getCommonVideoEditAttributes().concat([ if (areErrorsInScheduleUpdate(req, res)) return cleanUpReqFiles(req) if (!await doesVideoExist(req.params.id, res)) return cleanUpReqFiles(req) - const video = res.locals.video - // Check if the user who did the request is able to update the video const user = res.locals.oauth.token.User if (!checkUserCanManageVideo(user, res.locals.video, UserRight.UPDATE_ANY_VIDEO, res)) return cleanUpReqFiles(req) - if (video.privacy !== VideoPrivacy.PRIVATE && req.body.privacy === VideoPrivacy.PRIVATE) { - cleanUpReqFiles(req) - return res.status(409) - .json({ error: 'Cannot set "private" a video that was not private.' }) - } - if (req.body.channelId && !await doesVideoChannelOfAccountExist(req.body.channelId, user, res)) return cleanUpReqFiles(req) return next() -- cgit v1.2.3