【问题标题】:how to set the special roles to an account in orionjs?如何在 orionjs 中为帐户设置特殊角色?
【发布时间】:2016-02-01 13:13:51
【问题描述】:

我想通过 javascript 代码通过 o​​rion.js(meteor.js 开发的 cms 系统)将某些角色与某些帐户相关联。

怎么做?你能告诉我角色表在哪里,哪个对象是角色管理对象吗?我在哪里可以获得角色列表?

【问题讨论】:

    标签: javascript meteor meteor-accounts


    【解决方案1】:

    我知道怎么做,例如在夹具文件中:

      Accounts.createUser({
        username: 'admin',
        email: 'someone@somedomain.com',
        password: '123456',
        profile: { name: 'MyUser1' },
        roles: ['admin'], // or [] if this is not an admin
      });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-09
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 2017-10-07
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多