neos-development-collection
neos-development-collection copied to clipboard
FEATURE: `isDescendantOfNodetype` matcher
I have added the isDescendantOfNodetype Condition in the Condition Generator, which uses the newly created DecendantOfNodetypeConditionGenerator in the flow-development-collection Repository (merge request pending). It makes it possible to add a matcher to the Policies that matches all Nodes that are a descendant of the given Nodetype.
Example: Iww.IwwDe:Artikel: matcher: isDescendantOfNodetype(['Iww.NodeTypes:Documents.ArtikelCenshare'])
The above shown example matches all Nodes (and the node itself) that are of a certain type and makes it possible for example, using this privilegeTarget matcher, to forbid the editing of the given nodetype and all its children.
Review instructions
We needed that functionality, so we can have nodetypes that are only editable by someone with the correct role.
You can verify this change by using the isDescendantOfNodetype privilege target in a Policy.yaml and adding it to a role or use the added tests.
Checklist
- [x] Code follows the PSR-2 coding style
- [x] Tests have been created, run and adjusted as needed
- [x] The PR is created against the lowest maintained branch
- [ ] Reviewer - PR Title is brief but complete and starts with
FEATURE|TASK|BUGFIX
- [ ] Reviewer - The first section explains the change briefly for change-logs
- [ ] Reviewer - Breaking Changes are marked with
!!!
and have upgrade-instructions