remove dupe

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

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

Loading…
Cancel
Save