From 0563bb5923efdbc51469fef23da558df5ae3ff03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 28 May 2015 13:27:09 -0400 Subject: [PATCH] allow member.isOwner to work on an array --- src/groups/ownership.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/groups/ownership.js b/src/groups/ownership.js index 38d5a699d8..a6bb78e8e6 100644 --- a/src/groups/ownership.js +++ b/src/groups/ownership.js @@ -8,7 +8,11 @@ module.exports = function(Groups) { Groups.ownership.isOwner = function(uid, groupName, callback) { // Note: All admins automatically become owners upon joining - db.isSetMember('group:' + groupName + ':owners', uid, callback); + if (Array.isArray(uid)) { + db.isSetMembers('group:' + groupName + ':owners', uid, callback); + } else { + db.isSetMember('group:' + groupName + ':owners', uid, callback); + } }; Groups.ownership.grant = function(toUid, groupName, callback) {