Meteor User Property
meteor
Solution
To anyone in the future, simply assign the value in the users table in the database. You can publish additional fields to the user using the following:
Meteor.publish("userData", function () {
return Meteor.users.find({_id: this.userId}, {fields: {'admin': 1}});
});
And on the client:
Meteor.subscribe("userData");
Poof. Straight from the documentation.
Problem
I'd like to be able to mark users as "admin" in the Meteor auth system, and allow that user to do special things, as well as show some gui elements I wouldn't show if they weren't an admin. I've already tried setting an "admin" property on the user object, which would work fine on the server side (for the RPCs for the admin actions), however I need to access it on the client side to change the rendering of the page, and it appears only emails is sent with the Meteor.user() object. Basic question: How can I assign a user-specific property that both the server and client can see?