fix group chat syncing

This commit is contained in:
Matteo Pagliazzi
2013-10-24 14:44:08 +02:00
parent b23ce8426b
commit 3a45e72138
2 changed files with 3 additions and 3 deletions

View File

@@ -103,7 +103,8 @@ api.getGroup = function(req, res, next) {
Group.findById(gid).populate('members', partyFields).exec(function(err, group){
if ( (group.type == 'guild' && group.privacy == 'private') || group.type == 'party') {
return res.json(401, {err: "You don't have access to this group"});
if(!_.find(group.members, {_id: user._id}))
return res.json(401, {err: "You don't have access to this group"});
}
// Remove self from party (see above failing `match` directive in `populate`
if (group.type == 'party') {