core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php | 6 ------ core/lib/Drupal/Core/Field/FieldItemList.php | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php index 805c0f2..1530693 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php @@ -350,12 +350,6 @@ public function fieldAccess($operation, FieldDefinitionInterface $field_definiti * The access result. */ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) { - if ($operation === 'edit') { - $access = $field_definition->isReadOnly() ? AccessResult::forbidden() : AccessResult::allowed(); - $access->addCacheableDependency($field_definition); - return $access; - } - return AccessResult::allowed(); } diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php index 97dd493..55b0174 100644 --- a/core/lib/Drupal/Core/Field/FieldItemList.php +++ b/core/lib/Drupal/Core/Field/FieldItemList.php @@ -169,6 +169,13 @@ public function access($operation = 'view', AccountInterface $account = NULL, $r * {@inheritdoc} */ public function defaultAccess($operation = 'view', AccountInterface $account = NULL) { + if ($operation === 'edit') { + $field_definition = $this->getFieldDefinition(); + $access = $field_definition->isReadOnly() ? AccessResult::forbidden() : AccessResult::allowed(); + $access->addCacheableDependency($field_definition); + return $access; + } + // Grant access per default. return AccessResult::allowed(); }