remove dupe

v1.18.x
barisusakli 9 years ago
parent c22d018617
commit 8c17de4221

@ -301,16 +301,18 @@ module.exports = function(privileges) {
};
privileges.categories.give = function(privileges, cid, groupName, callback) {
async.each(privileges, function(privilege, next) {
groups.join('cid:' + cid + ':privileges:groups:' + privilege, groupName, next);
}, callback);
giveOrRescind(groups.join, privileges, groupName, callback);
};
privileges.categories.rescind = function(privileges, cid, groupName, callback) {
giveOrRescind(groups.leave, privileges, groupName, callback);
};
function giveOrRescind(method, privileges, cid, groupName, callback) {
async.each(privileges, function(privilege, next) {
groups.leave('cid:' + cid + ':privileges:groups:' + privilege, groupName, next);
method('cid:' + cid + ':privileges:groups:' + privilege, groupName, next);
}, callback);
};
}
privileges.categories.canMoveAllTopics = function(currentCid, targetCid, uid, callback) {
async.parallel({

Loading…
Cancel
Save