import * as express from 'express'
-import 'express-validator'
import { UserRight } from '../../shared'
import { logger } from '../helpers/logger'
const message = `User ${user.username} does not have right ${UserRight[userRight]} to access to ${req.path}.`
logger.info(message)
- return res.status(403)
- .json({
- error: message
- })
- .end()
+ return res.status(403).json({ error: message })
}
return next()