code: function loginRequired(fn) {
    return function(req, res, next) {
      if(isLoggedIn(req)) {
        fn(req, res, next);
      } else {
        next(new exceptions.PermissionRequired());
      }
    }
  }
docs: Middleware indicating that the view `fn` requires login
  @param fn
  @returns {Function}