Reputation: 19849
I want to add more functionality to the users collection. For example:
user.priviledges = ['admin']
or anything else...
Upvotes: 1
Views: 174
Reputation: 75945
Yes you can. Just run it as you would with Meteor.users
For instance for the user with id 1234
Meteor.users.update({_id: '1234'}, {$set: {priviledges: ['admin'] } });
Be sure to set .allow
rules if you're doing this from the client.
But as mentioned in the comments the best for these role type properties use the meteor-roles package on atmosphere.
Upvotes: 1
Reputation: 298
You can do it when registering a new user.
Accounts.onCreateUser(function (options, user) {
user.profile = {
name : "Ugur",
surname : "Toprakdeviren",
sex : true
};
return user;
});
Upvotes: 1