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