diff --git a/core/modules/node/src/Controller/NodeViewController.php b/core/modules/node/src/Controller/NodeViewController.php index 2e68391..c202d07 100644 --- a/core/modules/node/src/Controller/NodeViewController.php +++ b/core/modules/node/src/Controller/NodeViewController.php @@ -25,8 +25,12 @@ class NodeViewController extends EntityViewController { $build['#title'] = $build['nodes']['#title']; unset($build['nodes']['#title']); + // Add uri relationships as link tags. foreach ($node->uriRelationships() as $rel) { - // Set the node path as the canonical URL to prevent duplicate content. + // Only add links the user is allowed to visit. + if (!$node->urlInfo($rel)->access()) { + continue; + } $build['#attached']['html_head_link'][] = array( array( 'rel' => $rel,