diff --git a/Neos.Flow/Classes/Security/Authorization/Privilege/Entity/Doctrine/DecendantOfNodetypeConditionGenerator.php b/Neos.Flow/Classes/Security/Authorization/Privilege/Entity/Doctrine/DecendantOfNodetypeConditionGenerator.php new file mode 100644 index 0000000000..c2edaeb67d --- /dev/null +++ b/Neos.Flow/Classes/Security/Authorization/Privilege/Entity/Doctrine/DecendantOfNodetypeConditionGenerator.php @@ -0,0 +1,49 @@ +nodetypes = $nodetypes; + } + + /** + * Returns an SQL query part that is basically a no-op in order to match any entity + * + * @param DoctrineSqlFilter $sqlFilter + * @param ClassMetadata $targetEntity + * @param string $targetTableAlias + * @return string + */ + public function getSql(DoctrineSqlFilter $sqlFilter, ClassMetadata $targetEntity, $targetTableAlias) + { + $nodetypeList = implode("','", $this->nodetypes); + + return "select * from public.neos_contentrepository_domain_model_nodedata n1 + JOIN public.neos_contentrepository_domain_model_nodedata n2 ON n1.path LIKE CONCAT('%', n2.path, '%') + WHERE n2.nodetype in ('" . $nodetypeList . "')"; + } +}