Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Check if site node exists in context before running policy check #4649

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Neos.Neos/Classes/Controller/Backend/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* source code.
*/

use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\ContentRepository\Domain\Utility\NodePaths;
use Neos\ContentRepository\Security\Authorization\Privilege\Node\NodePrivilegeSubject;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Exception;
Expand Down Expand Up @@ -97,8 +99,8 @@ public function buildSiteList(ControllerContext $controllerContext): array
$domainsFound = false;
$sites = [];
foreach ($this->siteRepository->findOnline() as $site) {
$node = $context->getNode(\Neos\ContentRepository\Domain\Utility\NodePaths::addNodePathSegment(SiteService::SITES_ROOT_PATH, $site->getNodeName()));
if ($this->privilegeManager->isGranted(NodeTreePrivilege::class, new NodePrivilegeSubject($node))) {
$node = $context->getNode(NodePaths::addNodePathSegment(SiteService::SITES_ROOT_PATH, $site->getNodeName()));
if ($node instanceof NodeInterface && $this->privilegeManager->isGranted(NodeTreePrivilege::class, new NodePrivilegeSubject($node))) {
$uri = null;
$active = false;
/** @var $site Site */
Expand Down
Loading