mirror of
https://github.com/linnovate/mean.git
synced 2026-01-18 15:16:36 +00:00
* feat: upgrade to Angular 13 * feat: switch to ESLint since TSLint has been deprecated * feat: upgrade outdated Node.js packages and Node version within the Dockerfile
10 lines
252 B
JavaScript
10 lines
252 B
JavaScript
const httpError = require('http-errors');
|
|
|
|
const requireAdmin = function (req, res, next) {
|
|
if (req.user && req.user.roles.indexOf('admin') > -1) return next();
|
|
const err = new httpError(401);
|
|
return next(err);
|
|
};
|
|
|
|
module.exports = requireAdmin;
|