From fde8e9d90f92ef1d3cf8379f44eecf8879fcbcbb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 23 Jul 2014 13:32:23 -0400 Subject: [PATCH] on group destroy, remove it from all groups previously if a group was destroyed it was left behind in privilege groups --- src/groups.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/groups.js b/src/groups.js index 23c8fd2d01..b4bebdcc6d 100644 --- a/src/groups.js +++ b/src/groups.js @@ -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); };