|
|
@ -39,13 +39,17 @@ module.exports = function(privileges) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isModerator: function(next) {
|
|
|
|
isModerator: function(next) {
|
|
|
|
user.isModerator(uid, cid, next);
|
|
|
|
user.isModerator(uid, cid, next);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
disabled: function(next) {
|
|
|
|
|
|
|
|
categories.getCategoryField(cid, 'disabled', next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function(err, results) {
|
|
|
|
}, function(err, results) {
|
|
|
|
if(err) {
|
|
|
|
if(err) {
|
|
|
|
return callback(err);
|
|
|
|
return callback(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var disabled = parseInt(results.disabled, 10) === 1;
|
|
|
|
var isAdminOrMod = results.isAdministrator || results.isModerator;
|
|
|
|
var isAdminOrMod = results.isAdministrator || results.isModerator;
|
|
|
|
var editable = isAdminOrMod || results.manage_topic;
|
|
|
|
var editable = isAdminOrMod || results.manage_topic;
|
|
|
|
var deletable = isAdminOrMod || results.isOwner;
|
|
|
|
var deletable = isAdminOrMod || results.isOwner;
|
|
|
|
|
|
|
|
|
|
|
|
callback(null, {
|
|
|
|
callback(null, {
|
|
|
@ -54,7 +58,8 @@ module.exports = function(privileges) {
|
|
|
|
view_thread_tools: editable || deletable,
|
|
|
|
view_thread_tools: editable || deletable,
|
|
|
|
editable: editable,
|
|
|
|
editable: editable,
|
|
|
|
deletable: deletable,
|
|
|
|
deletable: deletable,
|
|
|
|
view_deleted: isAdminOrMod || results.manage_topic || results.isOwner
|
|
|
|
view_deleted: isAdminOrMod || results.manage_topic || results.isOwner,
|
|
|
|
|
|
|
|
disabled: disabled
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|