function ChangedFieldItemList::defaultAccess

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

Overrides FieldItemList::defaultAccess

File

core/lib/Drupal/Core/Field/ChangedFieldItemList.php, line 16

Class

ChangedFieldItemList
Defines an item list class for changed fields.

Namespace

Drupal\Core\Field

Code

public function defaultAccess($operation = 'view', AccountInterface $account = NULL) {
    // It is not possible to edit the changed field.
    return AccessResult::allowedIf($operation !== 'edit');
}

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