1 import { logger } from '../helpers'
3 function ensureIsAdmin (req, res, next) {
4 const user = res.locals.oauth.token.user
5 if (user.isAdmin() === false) {
6 logger.info('A non admin user is trying to access to an admin content.')
7 return res.sendStatus(403)
13 // ---------------------------------------------------------------------------