punktde/noderestrictions

该软件包允许编辑器通过后端检查器限制节点及其子节点的访问权限到定义的角色。

安装数: 3,123

依赖项: 0

建议者: 0

安全性: 0

星标: 3

关注者: 6

分支: 3

开放问题: 1

类型:neos-package

2.0.4 2023-07-20 13:10 UTC

README

Latest Stable Version Total Downloads License

它做什么

该软件包允许编辑器通过后端检查器限制节点及其子节点的访问权限到定义的角色。

配置

定义角色和权限

使用ReadNodePrivilege将角色和权限目标添加到项目的 Policy.yaml。在这个例子中,我们使用Flowpack.Neos.FrontendLogin 包进行身份验证,因此该角色继承自 Flowpack.Neos.FrontendLogin:User

privilegeTargets:
  'PunktDe\NodeRestrictions\Security\Authorization\Privilege\Node\ReadNodePrivilege':
    'Vendor.Customer:RestrictNodeToRole1':
      matcher: 'nodePropertyIs("accessRestriction", "Vendor.Customer:Role1") || parentNodePropertyIs("accessRestriction", "Vendor.Customer:Role1")'

roles:
  'Vendor.Customer:Role1':
    parentRoles: ['Flowpack.Neos.FrontendLogin:User']
    privileges:
      -
        privilegeTarget: 'Vendor.Customer:RestrictNodeToRole1'
        permission: GRANT

  'Neos.Neos:AbstractEditor':
    privileges:
      -
        privilegeTarget: 'Vendor.Customer:RestrictNodeToRole1'
        permission: GRANT

从选择中排除角色

某些系统角色,特别是后端角色,不应该在后台选择器中显示。您可以使用设置来排除它们。支持通配符。

PunktDe:
  NodeRestrictions:
    excludeRolesFromPackages:
      - Neos.Neos
      - Flowpack.*
    excludeSpecificRoles:
      - Neos.Neos:Editor