diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/videos.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js index ff18a99c2..3d7c04b60 100644 --- a/server/middlewares/validators/videos.js +++ b/server/middlewares/validators/videos.js | |||
@@ -53,6 +53,14 @@ function videosUpdate (req, res, next) { | |||
53 | logger.debug('Checking videosUpdate parameters', { parameters: req.body }) | 53 | logger.debug('Checking videosUpdate parameters', { parameters: req.body }) |
54 | 54 | ||
55 | checkErrors(req, res, function () { | 55 | checkErrors(req, res, function () { |
56 | if (res.locals.video.isOwned() === false) { | ||
57 | return res.status(403).send('Cannot update video of another pod') | ||
58 | } | ||
59 | |||
60 | if (res.locals.video.Author.userId !== res.locals.oauth.token.User.id) { | ||
61 | return res.status(403).send('Cannot update video of another user') | ||
62 | } | ||
63 | |||
56 | checkVideoExists(req.params.id, res, next) | 64 | checkVideoExists(req.params.id, res, next) |
57 | }) | 65 | }) |
58 | } | 66 | } |