lib/auth.js
function requireAdminOr401(req, res, next) {
  if (!req.user || !req.user['account_level'] || req.user.account_level < 1) {
    res.status(401).send('not authorized');
  } else {
    next();
  }
}
function requireAdminOr401(req, res, next) {
  if (!req.user || !req.user['account_level'] || req.user.account_level < 1) {
    res.status(401).send('not authorized');
  } else {
    next();
  }
}
function requireAdminOr401 ( req , res , next ) { if ( ! req . user || ! req . user [ 'account_level' ] || req . user . account_level < 1 ) { res . status ( 401 ) . send ( 'not authorized' ) ; } else { next ( ) ; } }
Require admin privileges
Require admin privileges