lib/auth.js
function requireProjectAdmin(req, res, next) {
  if (!req.project) return res.status(404).send('Project not loaded');
  if (!req.user) return res.status(401).send('No user');
  var isAdmin = req.user.account_level && req.user.account_level > 0;
  var notAuthed = (!req.accessLevel || req.accessLevel < 2) && !isAdmin;
  if (notAuthed) return res.status(401).send('Not authorized for configuring this project');
  next();
}
function requireProjectAdmin(req, res, next) {
  if (!req.project) return res.status(404).send('Project not loaded');
  if (!req.user) return res.status(401).send('No user');
  var isAdmin = req.user.account_level && req.user.account_level > 0;
  var notAuthed = (!req.accessLevel || req.accessLevel < 2) && !isAdmin;
  if (notAuthed) return res.status(401).send('Not authorized for configuring this project');
  next();
}
Require the logged-in user to have admin access to the repository in the URI path. E.g. http://striderapp.com/beyondfog/strider/latest_build