only delete priv groups if they are empty

This commit is contained in:
barisusakli
2016-10-12 16:45:33 +03:00
parent a1a21a5bf9
commit 58810aa063

View File

@@ -240,7 +240,7 @@ module.exports = function(Groups) {
if (!groupData) {
return callback();
}
if (parseInt(groupData.hidden, 10) === 1 && parseInt(groupData.memberCount, 10) === 0) {
if (Groups.isPrivilegeGroup(groupName) && parseInt(groupData.memberCount, 10) === 0) {
Groups.destroy(groupName, next);
} else {
if (parseInt(groupData.hidden, 10) !== 1) {