You are here

class EntityViewDisplayAccessControlHandler in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Entity/Access/EntityViewDisplayAccessControlHandler.php \Drupal\Core\Entity\Entity\Access\EntityViewDisplayAccessControlHandler
  2. 9 core/lib/Drupal/Core/Entity/Entity/Access/EntityViewDisplayAccessControlHandler.php \Drupal\Core\Entity\Entity\Access\EntityViewDisplayAccessControlHandler

Provides an entity access control handler for displays.

Hierarchy

Expanded class hierarchy of EntityViewDisplayAccessControlHandler

1 file declares its use of EntityViewDisplayAccessControlHandler
EntityViewDisplayAccessControlHandlerTest.php in core/tests/Drupal/Tests/Core/Entity/Access/EntityViewDisplayAccessControlHandlerTest.php

File

core/lib/Drupal/Core/Entity/Entity/Access/EntityViewDisplayAccessControlHandler.php, line 13

Namespace

Drupal\Core\Entity\Entity\Access
View source
class EntityViewDisplayAccessControlHandler extends EntityAccessControlHandler {

  /**
   * {@inheritdoc}
   */
  protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {

    /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $entity */
    return parent::checkAccess($entity, $operation, $account)
      ->orIf(AccessResult::allowedIfHasPermission($account, 'administer ' . $entity
      ->getTargetEntityTypeId() . ' display'));
  }

}

Members