diff options
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r-- | server/middlewares/validators/videos/video-channels.ts | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index fc717abf6..ec107fa51 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts | |||
@@ -65,22 +65,6 @@ const videoChannelsUpdateValidator = [ | |||
65 | logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body }) | 65 | logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body }) |
66 | 66 | ||
67 | if (areValidationErrors(req, res)) return | 67 | if (areValidationErrors(req, res)) return |
68 | if (!await doesVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return | ||
69 | |||
70 | // We need to make additional checks | ||
71 | if (res.locals.videoChannel.Actor.isOwned() === false) { | ||
72 | return res.fail({ | ||
73 | status: HttpStatusCode.FORBIDDEN_403, | ||
74 | message: 'Cannot update video channel of another server' | ||
75 | }) | ||
76 | } | ||
77 | |||
78 | if (res.locals.videoChannel.Account.userId !== res.locals.oauth.token.User.id) { | ||
79 | return res.fail({ | ||
80 | status: HttpStatusCode.FORBIDDEN_403, | ||
81 | message: 'Cannot update video channel of another user' | ||
82 | }) | ||
83 | } | ||
84 | 68 | ||
85 | return next() | 69 | return next() |
86 | } | 70 | } |