.../node/src/Cache/NodeAccessViewGrantsCacheContext.php | 5 +---- .../node/src/Tests/NodeAccessViewGrantsCacheContextTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/modules/node/src/Cache/NodeAccessViewGrantsCacheContext.php b/core/modules/node/src/Cache/NodeAccessViewGrantsCacheContext.php index e0db9e4..24323b9 100644 --- a/core/modules/node/src/Cache/NodeAccessViewGrantsCacheContext.php +++ b/core/modules/node/src/Cache/NodeAccessViewGrantsCacheContext.php @@ -54,10 +54,7 @@ public function getContext() { // hook_node_grants() implementations) // then we don't need to determine the exact node view grants for the // current user. - if ($this->user->hasPermission('bypass node access')) { - return 'bypass'; - } - if (node_access_view_all_nodes($this->user)) { + if ($this->user->hasPermission('bypass node access') || node_access_view_all_nodes($this->user)) { return 'all'; } diff --git a/core/modules/node/src/Tests/NodeAccessViewGrantsCacheContextTest.php b/core/modules/node/src/Tests/NodeAccessViewGrantsCacheContextTest.php index 94adac7..419e6af 100644 --- a/core/modules/node/src/Tests/NodeAccessViewGrantsCacheContextTest.php +++ b/core/modules/node/src/Tests/NodeAccessViewGrantsCacheContextTest.php @@ -82,7 +82,7 @@ protected function assertCacheContext(array $expected) { public function testCacheContext() { $this->assertCacheContext([ 0 => 'all:0;node_access_test_author:0;node_access_all:0', - 1 => 'bypass', + 1 => 'all', 2 => 'all:0;node_access_test_author:2;node_access_test:8888,8889', 3 => 'all:0;node_access_test_author:3', ]); @@ -104,7 +104,7 @@ public function testCacheContext() { drupal_static_reset('node_access_view_all_nodes'); $this->assertCacheContext([ 0 => 'all', - 1 => 'bypass', + 1 => 'all', 2 => 'all:0;node_access_test_author:2;node_access_test:8888,8889', 3 => 'all:0;node_access_test_author:3', ]); @@ -114,7 +114,7 @@ public function testCacheContext() { drupal_static_reset('node_access_view_all_nodes'); $this->assertCacheContext([ 0 => 'all:0;node_access_test_author:0', - 1 => 'bypass', + 1 => 'all', 2 => 'all', 3 => 'all:0;node_access_test_author:3', ]); @@ -124,7 +124,7 @@ public function testCacheContext() { drupal_static_reset('node_access_view_all_nodes'); $this->assertCacheContext([ 0 => 'all:0;node_access_test_author:0', - 1 => 'bypass', + 1 => 'all', 2 => 'all:0;node_access_test_author:2;node_access_test:8888,8889', 3 => 'all', ]); @@ -134,7 +134,7 @@ public function testCacheContext() { drupal_static_reset('node_access_view_all_nodes'); $this->assertCacheContext([ 0 => 'all', - 1 => 'bypass', + 1 => 'all', 2 => 'all', 3 => 'all', ]);