diff --git a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php index 68db756..5464e13 100644 --- a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php +++ b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php @@ -118,15 +118,7 @@ public function checkNodeAccess(array $tree) { // Allow admins to also see unpublished nodes as menu links. if (!$this->account->hasPermission('bypass node access')) { - if ($this->account->hasPermission('view own unpublished content')) { - $group = $query->orConditionGroup(); - $group->condition('status', NODE_PUBLISHED); - $group->condition('uid', $this->account->id()); - $query->condition($group); - } - else { - $query->condition('status', NODE_PUBLISHED); - } + $query->condition('status', NODE_PUBLISHED); } $nids = $query->execute(); diff --git a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php index 93b4644..c790229 100644 --- a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php @@ -292,7 +292,7 @@ public function testCheckNodeAccess() { ->with('nid', array(1, 2, 3, 4)); $query->expects($this->at(1)) ->method('condition') - ->with('status', 1); + ->with('status', NODE_PUBLISHED); $query->expects($this->once()) ->method('execute') ->willReturn(array(1, 2, 4));