mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
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:
@@ -327,6 +327,16 @@
|
|||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
db.delete('group:' + groupName + ':members', 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);
|
], callback);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user