allowing moderators access to the account info page

This commit is contained in:
Julian Lam
2016-10-24 15:58:57 -04:00
parent 9a0d81ef6b
commit 2463e85c0d
3 changed files with 28 additions and 3 deletions

View File

@@ -34,6 +34,18 @@ module.exports = function (middleware) {
}
user.isAdminOrGlobalMod(req.uid, next);
},
function(allowed, next) {
if (allowed) {
return next(null, allowed);
}
// For the account/info page only, allow plain moderators through
if (/user\/.+\/info$/.test(req.path)) {
user.isModeratorOfAnyCategory(req.uid, next);
} else {
next(null, false);
}
}
], function (err, allowed) {
if (err || allowed) {