Server: fix update right checks
This commit is contained in:
parent
edc5e86006
commit
63d00f5ded
|
@ -53,6 +53,8 @@ function videosUpdate (req, res, next) {
|
||||||
logger.debug('Checking videosUpdate parameters', { parameters: req.body })
|
logger.debug('Checking videosUpdate parameters', { parameters: req.body })
|
||||||
|
|
||||||
checkErrors(req, res, function () {
|
checkErrors(req, res, function () {
|
||||||
|
checkVideoExists(req.params.id, res, function () {
|
||||||
|
// We need to make additional checks
|
||||||
if (res.locals.video.isOwned() === false) {
|
if (res.locals.video.isOwned() === false) {
|
||||||
return res.status(403).send('Cannot update video of another pod')
|
return res.status(403).send('Cannot update video of another pod')
|
||||||
}
|
}
|
||||||
|
@ -61,7 +63,8 @@ function videosUpdate (req, res, next) {
|
||||||
return res.status(403).send('Cannot update video of another user')
|
return res.status(403).send('Cannot update video of another user')
|
||||||
}
|
}
|
||||||
|
|
||||||
checkVideoExists(req.params.id, res, next)
|
next()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue