some checks to make last admin isnt removed

This commit is contained in:
barisusakli
2014-06-13 22:48:24 -04:00
parent 842a1f90cf
commit 07275b5fc4
3 changed files with 31 additions and 11 deletions

View File

@@ -150,6 +150,10 @@
db.isSetMember('group:' + groupName + ':members', uid, callback);
};
Groups.getMemberCount = function(groupName, callback) {
db.setCount('group:' + groupName + ':members', callback);
};
Groups.isMemberOfGroupList = function(uid, groupListKey, callback) {
db.getSetMembers('group:' + groupListKey + ':members', function(err, groupNames) {
groupNames = internals.removeEphemeralGroups(groupNames);