新しく作成されたすべてのユーザーに属性「許可」を追加しようとしました。しかし、それはどういうわけかうまくいきません。このコードを使用して属性を追加します
Accounts.onCreateUser(function(options, user) {
user.permission = 'default';
if (options.profile)
user.profile = options.profile;
return user;
});
しかし、クライアント側でユーザー オブジェクトを取得すると、属性が表示されません
u = Meteor.users.findOne(Meteor.userId)
u.permission
>undefined
私は何を間違っていますか?