function BaseFieldOverrideAccessControlHandler::checkAccess

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php \Drupal\Core\Field\BaseFieldOverrideAccessControlHandler::checkAccess()
  2. 10 core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php \Drupal\Core\Field\BaseFieldOverrideAccessControlHandler::checkAccess()
  3. 11.x core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php \Drupal\Core\Field\BaseFieldOverrideAccessControlHandler::checkAccess()

Overrides EntityAccessControlHandler::checkAccess

File

core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php, line 18

Class

BaseFieldOverrideAccessControlHandler
Provides en entity access control handler for base field override entity.

Namespace

Drupal\Core\Field

Code

protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
    $access = parent::checkAccess($entity, $operation, $account);
    return $access->orIf(AccessResult::allowedIfHasPermission($account, 'administer ' . $entity->getTargetEntityTypeId() . ' fields'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.