punktde / noderestrictions
该软件包允许编辑器通过后端检查器限制节点及其子节点的访问权限到定义的角色。
This package is auto-updated.
Last update: 2024-09-20 15:41:24 UTC
README
它做什么
该软件包允许编辑器通过后端检查器限制节点及其子节点的访问权限到定义的角色。
配置
定义角色和权限
使用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