I am having a problem listing all users in a user collection. When I take the listing page, only the current registered user data is displayed. But all users become enumerated after updating the page and its beautiful.
On the server side, I have the following publish code
Meteor.publish("userList", function() { var user = Meteor.users.findOne({ _id: this.userId }); if (Roles.userIsInRole(user, ["admin"])) { return Meteor.users.find({}, { fields: { profile_name: 1, emails: 1, roles: 1, contact_info: 1 } }); } this.stop(); return; });
Client side
Meteor.subscribe('userList');
In the js template file, I make the following call
Meteor.users.find();
Please help me with this problem. What am I missing here?
source share