BaseFieldOverrideAccessControlHandler.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php
  2. 10 core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php
  3. 11.x core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php

Namespace

Drupal\Core\Field

File

core/lib/Drupal/Core/Field/BaseFieldOverrideAccessControlHandler.php

View source
<?php

namespace Drupal\Core\Field;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * Provides en entity access control handler for base field override entity.
 */
class BaseFieldOverrideAccessControlHandler extends EntityAccessControlHandler {
    
    /**
     * {@inheritdoc}
     */
    protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
        $access = parent::checkAccess($entity, $operation, $account);
        return $access->orIf(AccessResult::allowedIfHasPermission($account, 'administer ' . $entity->getTargetEntityTypeId() . ' fields'));
    }

}

Classes

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

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