Skip to content

Commit

Permalink
Merge pull request #1 from gjwnc/patch-1
Browse files Browse the repository at this point in the history
Update MoveNodePrivilege.php
  • Loading branch information
kdambekalns authored May 20, 2019
2 parents ef053b2 + a1e19a3 commit 579c3b5
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ 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 (
($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;
}
}
}

Expand Down

0 comments on commit 579c3b5

Please sign in to comment.