ChangedFieldItemList::defaultAccess

public ChangedFieldItemList::defaultAccess($operation = 'view', AccountInterface $account = NULL)

Contains the default access logic of this field.

See \Drupal\Core\Entity\EntityAccessControlHandlerInterface::fieldAccess() for the parameter documentation.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

Overrides FieldItemList::defaultAccess

File

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

Class

ChangedFieldItemList
Defines a 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');
}
doc_Drupal
2016-10-29 08:49:52
Comments
Leave a Comment

Please login to continue.