From 92cc9aa5a1b0ffb8a29d287d9f75d61894b52f55 Mon Sep 17 00:00:00 2001 From: gj Date: Tue, 30 Apr 2019 16:41:08 +0200 Subject: [PATCH 1/2] Update MoveNodePrivilege.php A php notice prevents moving nodes in development context because `$item['class']` is not set. E.g. see the following `$item`: ``` array ( 'file' => '/tmp/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Security_Authorization_PrivilegeManager.php', 'line' => 81, 'function' => 'array_filter', ) ``` --- .../Privilege/Node/MoveNodePrivilege.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php b/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php index 04ac26d..7ae9b4a 100644 --- a/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php +++ b/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php @@ -47,12 +47,14 @@ public function matchesSubject(PrivilegeSubjectInterface $subject) // - NodeOperations -> create $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10); foreach ($backtrace as $item) { - if ( - ($item['function'] === 'apply' && (strpos($item['class'], 'Neos\Neos\Ui\Domain\Model\Changes\CreateAfter') === 0 || strpos($item['class'], 'Neos\Neos\Ui\Domain\Model\Changes\CreateBefore') === 0)) - || ($item['function'] === 'create' && strpos($item['class'], 'Neos\Neos\Service\NodeOperations') === 0) - || (strpos($item['class'], 'Neos\ContentRepository\Domain\Model\Node') === 0 && ($item['function'] === 'copyBefore' || $item['function'] === 'copyAfter')) - ) { - return false; + if (isset($item['class'])) { + if ( + ($item['function'] === 'apply' && (strpos($item['class'], 'Neos\Neos\Ui\Domain\Model\Changes\CreateAfter') === 0 || strpos($item['class'], 'Neos\Neos\Ui\Domain\Model\Changes\CreateBefore') === 0)) + || ($item['function'] === 'create' && strpos($item['class'], 'Neos\Neos\Service\NodeOperations') === 0) + || (strpos($item['class'], 'Neos\ContentRepository\Domain\Model\Node') === 0 && ($item['function'] === 'copyBefore' || $item['function'] === 'copyAfter')) + ) { + return false; + } } } From a1e19a38eb8bdfbf004be3b1e7327aab77f6d59e Mon Sep 17 00:00:00 2001 From: gjwnc Date: Wed, 15 May 2019 16:47:18 +0200 Subject: [PATCH 2/2] Change backtrace limit from 10 to 15 --- .../Security/Authorization/Privilege/Node/MoveNodePrivilege.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php b/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php index 7ae9b4a..bf442fd 100644 --- a/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php +++ b/Classes/Security/Authorization/Privilege/Node/MoveNodePrivilege.php @@ -45,7 +45,7 @@ public function matchesSubject(PrivilegeSubjectInterface $subject) // - CreateBefore, CreatAfter -> apply() // - Node(Interface) -> copyBefore, copyAfter // - NodeOperations -> create - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10); + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 15); foreach ($backtrace as $item) { if (isset($item['class'])) { if (