diff --git a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php index dd72bb7..f9b6261 100644 --- a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php +++ b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Menu; use Drupal\Core\Access\AccessManagerInterface; +use Drupal\Core\Path\PathValidator; use Drupal\Core\Session\AccountInterface; /** @@ -93,7 +94,7 @@ public function checkAccess(array $tree) { * TRUE if the current user can access the link, FALSE otherwise. */ protected function menuLinkCheckAccess(MenuLinkInterface $instance) { - if ($this->account->hasPermission('link to any page')) { + if ($this->account->hasPermission(PathValidator::LINK_PERMISSION)) { return TRUE; } // Use the definition here since that's a lot faster than creating a Url diff --git a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php index 9d9ce37..89ff6da 100644 --- a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php +++ b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php @@ -8,14 +8,9 @@ namespace Drupal\link\Plugin\Validation\Constraint; use Drupal\link\LinkItemInterface; -use Drupal\Core\Url; -use Drupal\Core\Routing\MatchingRouteNotFoundException; -use Drupal\Core\ParamConverter\ParamNotConvertedException; -use Drupal\Component\Utility\UrlHelper; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidatorInterface; use Symfony\Component\Validator\ExecutionContextInterface; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Validation constraint for links receiving data allowed by its settings.