Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!11687
Avoid cache redirect error in NodeAccessControlHandler.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Avoid cache redirect error in NodeAccessControlHandler.
issue/drupal-3504114:3504114-quick-fix
into
11.x
Overview
0
Commits
1
Pipelines
1
Changes
2
Closed
catch
requested to merge
issue/drupal-3504114:3504114-quick-fix
into
11.x
2 months ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
Closes
#3504114
0
0
Merge request reports
Compare
11.x
11.x (base)
and
latest version
latest version
67e8e4b2
1 commit,
2 months ago
2 files
+
81
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
core/modules/node/src/NodeAccessControlHandler.php
+
9
−
0
Options
@@ -223,7 +223,16 @@ protected function checkViewAccess(NodeInterface $node, AccountInterface $accoun
return
NULL
;
}
// When access is granted due to the 'view own unpublished content'
// permission and for no other reason, node grants are bypassed. However,
// to ensure the full set of cacheable metadata is available to variation
// cache, additionally add the node_grants cache context so that if the
// status or the owner of the node changes, cache redirects will continue to
// reflect the latest state without needing to be invalidated.
$cacheability
->
addCacheContexts
([
'user'
]);
if
(
$this
->
moduleHandler
->
hasImplementations
(
'node_grants'
))
{
$cacheability
->
addCacheContexts
([
'user.node_grants:view'
]);
}
if
(
$account
->
id
()
!=
$node
->
getOwnerId
())
{
return
NULL
;
}
Loading