title: Meteor - Publish all Users to Client just for admin
body: <p>I have the folowing problem with Meteor:
  I have one admin, that needs to see all registered users.
  But all the other users shouldn't have the ability to see the other users.
  Therefore I published the following code on the serverside</p>
  
  <pre><code>Meteor.publish("adminUsers", function(){
  
     var result; 
     if (Roles.userIsInRole(this.userId, ["admin"]))
     {
          result = Meteor.users.find();
     }
     //console.log(result);
     return result;
  });
  </code></pre>
  
  <p>On client side I subscribe to this with</p>
  
  <pre><code>Meteor.subscribe("adminUsers");
  </code></pre>
  
  <p>And do </p>
  
  <pre><code>AllUsers = new Meteor.Collection("adminUsers");
  </code></pre>
  
  <p>Now I want to get all the Users in a Template with this code:</p>
  
  <pre><code>Template.adminUserverwaltung.AllUsers = function(){
  console.log(AllUsers.find());
  return AllUsers.find();
  }
  </code></pre>
  
  <p>and show the result in the template with this code:</p>
  
  <pre><code>    &lt;template name="adminUserverwaltung"&gt;
    {{#each AllUsers}}
      {{this.username}}
    {{/each}}
  &lt;/template&gt;
  </code></pre>
  
  <p>But unfortunately it is not working... Can anyone help me maybe?</p>