Meteor User Property

前端 未结 2 1491
说谎
说谎 2021-02-10 09:40

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 w

2条回答
  •  梦如初夏
    2021-02-10 10:10

    You can also add properties in "profile" attribute of the user. profile attribute is alrealy populated to client side :

    Meteor.users.update({_id: userId}, {$set: {'profile.admin': 1}});
    
    //on client side
    Meteor.user().profile.admin
    

提交回复
热议问题