punktde / inspectorvisibility
此包最新版本(0.1.3)没有提供许可证信息。
Neos 包,用于使用权限配置检查器元素的可见性
0.1.3
2022-08-15 10:07 UTC
Requires
- neos/neos: ^4.2 || ^5.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2024-09-15 14:27:40 UTC
README
此包允许您使用策略配置检查器元素的可见性,如属性、组和标签。通过这种方式,您可以根据用户的角色配置这些元素的可见性。
注意:尽管这是通过策略完成的,但这不是一个安全特性!
如果您阻止用户编辑节点,您还需要定义具有例如 EditNodePropertyPrivilege
的策略。
安装
安装通过 composer 完成
composer require punktde/inspectorvisibility
用法
匹配器可以使用标准的 eel 定义。以下是可以匹配的属性
- nodeTypeName
- tabName
- groupName
- propertyName
如果没有策略与角色匹配,则使用配置的可见性。同样,如果权限设置为 ABSTAIN
。
示例
示例 Policy.yaml
privilegeTargets:
'PunktDe\InspectorVisibility\Security\Authorization\Privilege\InspectorVisibilityPrivilege':
'PunktDe.InspectorVisibility:AdminFields':
matcher: "${tabName == 'meta' && groupName == 'nodeInfo'}"
roles:
'Neos.Neos:Editor':
privileges:
-
privilegeTarget: 'PunktDe.InspectorVisibility:AdminFields'
permission: DENY
匹配器示例
- 针对所有 uriPathSegment 属性:
matcher: "${propertyName == 'uriPathSegment'}
- 针对所有节点类型的所有 meta 选项卡:
"${tabName == 'meta'}"
- 针对特定类型的所有 title 字段:
matcher: "${nodeTypeName == 'Neos.Demo:Registration' && propertyName == 'title'}"