1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Server: rights check for update a video

This commit is contained in:
Chocobozzz 2017-01-11 18:41:09 +01:00
parent d8cc063e97
commit 45abb8b97b
2 changed files with 12 additions and 0 deletions

View file

@ -53,6 +53,14 @@ function videosUpdate (req, res, next) {
logger.debug('Checking videosUpdate parameters', { parameters: req.body })
checkErrors(req, res, function () {
if (res.locals.video.isOwned() === false) {
return res.status(403).send('Cannot update video of another pod')
}
if (res.locals.video.Author.userId !== res.locals.oauth.token.User.id) {
return res.status(403).send('Cannot update video of another user')
}
checkVideoExists(req.params.id, res, next)
})
}