const message = `User ${user.username} does not have right ${userRight} to access to ${req.path}.`
logger.info(message)
- return res.status(HttpStatusCode.FORBIDDEN_403)
- .json({ error: message })
+ return res.fail({
+ status: HttpStatusCode.FORBIDDEN_403,
+ message
+ })
}
return next()