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

@@ -328,8 +328,15 @@ SocketUser.setModerationNote = function (socket, data, callback) {
function (next) {
user.isAdminOrGlobalMod(socket.uid, next);
},
function (isAdminOrGlobalMod, next) {
if (!isAdminOrGlobalMod) {
function (allowed, next) {
if (allowed) {
return next(null, allowed);
}
user.isModeratorOfAnyCategory(socket.uid, next);
},
function (allowed, next) {
if (!allowed) {
return next(new Error('[[error:no-privileges]]'));
}
if (data.note) {