title: Meteor.users.find() - how to filter by group in alanning:roles package
body: <p>I'm trying to make an admin section on my website. The admin can go to the admin page and see a table of the users in his group. I only want to publish a the users that are in that admin's group. E.g. he is in the group ['soccer'] but I wouldn't want him to see all users in the ['hockey'] group. A user can be in more than one group but I should be able to figure that out once I understand how to query it.</p>
  
  <p>Anyways, here's what I have so far:</p>
  
  <pre><code>Meteor.publish('users', function() {
  
    groups = Roles.getGroupsForUser(this.userId)
    group = groups[0] //Just get the first group for now
  
    // If the user is an admin of any group (the first one in the array)
    if (Roles.userIsInRole(this.userId, ['admin'], group)) {
      return Meteor.users.find({roles: {$in: groups}}, 
                               {fields: {emails: 1,
                                         createdAt: 1,
                                         roles: 1
                                        }
      });
    } else {
      console.log('null')
      return null;
    }
  });
  </code></pre>
  
  <p>My subscription in my router:</p>
  
  <pre><code>Meteor.subscribe("users")
  </code></pre>
  
  <p>Now when I replace:</p>
  
  <pre><code>{roles: {$in: groups}} 
  </code></pre>
  
  <p>with just:</p>
  
  <pre><code>{}
  </code></pre>
  
  <p>It works, but my table contains all users instead of just the users of a group. 
  What query should I put to make this work? I'm using the roles package by alanning. </p>