function FieldItemList::access

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::access()
  2. 8.9.x core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::access()
  3. 10 core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::access()

Overrides AccessibleInterface::access

1 method overrides FieldItemList::access()
CommentFieldItemList::access in core/modules/comment/src/CommentFieldItemList.php
Checks data value access.

File

core/lib/Drupal/Core/Field/FieldItemList.php, line 152

Class

FieldItemList
Represents an entity field; that is, a list of field item objects.

Namespace

Drupal\Core\Field

Code

public function access($operation = 'view', ?AccountInterface $account = NULL, $return_as_object = FALSE) {
    $access_control_handler = \Drupal::entityTypeManager()->getAccessControlHandler($this->getEntity()
        ->getEntityTypeId());
    return $access_control_handler->fieldAccess($operation, $this->getFieldDefinition(), $account, $this, $return_as_object);
}

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