Parâmetro de passe de middleware expresso

function HasRole(role) {
  return function(req, res, next) {
    if (role !== req.user.role) res.redirect(...);
    else next();
  }
}
Light Locust