diff --git a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php index 0dc91b5..bc8bd59 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Entity; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Access\AccessResultForbidden; use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; @@ -59,12 +58,7 @@ public function access(Route $route, RouteMatchInterface $route_match, AccountIn if ($parameters->has($entity_type)) { $entity = $parameters->get($entity_type); if ($entity instanceof EntityInterface) { - $result = $entity->access($operation, $account, TRUE); - if ($result->isForbidden()) { - return AccessResultForbidden::forbidden("You are not authorized to view this {$entity->getEntityTypeId()} entity of bundle {$entity->bundle()}.") - ->mergeCacheMaxAge($result); - } - return $result; + return $entity->access($operation, $account, TRUE); } } // No opinion, so other access checks should decide if access should be