Giter Club home page Giter Club logo

Comments (2)

chenos avatar chenos commented on June 4, 2024 1

anonymous 角色是支持的

const roleName = ctx.state.currentRole || 'anonymous';

优化了一下,最新版 ab633af plugin-acl 插件安装时,会直接初始化 anonymous 角色,不需要自己另外添加 anonymous 角色了

anonymous 角色也是可以配置 scope 的

db.getRepository('roles.resources', 'anonymous').create({
  values: {
    name: "posts",
    actions: [
      {
        name: "view",         // get/list 在权限配置里对应的是 view
        fields: ["title", "content", "published"],
        scope,
      },
    ],
  },
});

有一个小细节,在配置权限时,get/list 对应的是 view,如上面例子。

view: {
displayName: '{{t("View")}}',
type: 'old-data',
aliases: ['get', 'list'],
allowConfigureFields: true,
},

from nocobase.

MarshalW avatar MarshalW commented on June 4, 2024

按照您的示例代码,更新到nocobase-next 最新分支,已经可以用了。

谢谢~

from nocobase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.