on group destroy, remove it from all groups

previously if a group was destroyed it was left behind in privilege
groups
This commit is contained in:
barisusakli
2014-07-23 13:32:23 -04:00
parent 5c57ed5ea0
commit fde8e9d90f

View File

@@ -327,6 +327,16 @@
},
function(next) {
db.delete('group:' + groupName + ':members', next);
},
function(next) {
db.getSetMembers('groups', function(err, groups) {
if (err) {
return next(err);
}
async.each(groups, function(group, next) {
db.setRemove('group:' + group + ':members', groupName, next);
}, next);
});
}
], callback);
};