You are here

class EntityFormDisplayAccessControlHandler in Drupal 10

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

Provides an entity access control handler for form displays.

Hierarchy

Expanded class hierarchy of EntityFormDisplayAccessControlHandler

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

File

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

Namespace

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

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

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

}

Members