diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php index 9144759..7c712bf 100644 --- a/core/includes/entity.api.php +++ b/core/includes/entity.api.php @@ -517,22 +517,21 @@ function hook_entity_field_info_alter(&$info, $entity_type) { * Alters the default access behaviour for a given field. * * This hook is invoked from \Drupal\Core\Entity\Field\Type\Field::access() to - * let modules alter access to operations on fields. As soon as one hook - * implementation changes $access to FALSE the access() method will return FALSE - * and the remaining hook implementations will not be invoked. + * let modules alter access to operations on fields. * * @param bool $access * Access flag reference that can be altered. TRUE if the operation is * allowed, and FALSE if the operation is denied. * @param string $operation - * The operation to be performed. Possible values: 'edit', 'view'. + * The operation to be performed. Supported values: 'view', 'create', 'update', + * 'delete'. * @param \Drupal\Core\Entity\Field\Type\Field $field * The entity field object on which the operation is to be performed. * @param \Drupal\user\Plugin\Core\Entity\User $account * The user account to check. */ function hook_entity_field_access_alter(&$access, $operation, $field, $account) { - if ($field->getName() == 'field_of_interest' && $operation == 'edit') { - $access = user_access('edit field of interest', $account); + if ($field->getName() == 'field_of_interest' && $operation == 'update') { + $access = user_access('update field of interest', $account); } } diff --git a/core/lib/Drupal/Core/Entity/Field/Type/Field.php b/core/lib/Drupal/Core/Entity/Field/Type/Field.php index 60ff158..d696da2 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/Field.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/Field.php @@ -292,11 +292,6 @@ public function access($operation = 'view', User $account = NULL) { foreach (module_implements('entity_field_access_alter') as $module) { $function = $module . '_entity_field_access_alter'; $function($access, $operation, $this, $account); - // If a hook implementation altered $access to FALSE we can return - // immediately. - if ($access === FALSE) { - return FALSE; - } } return $access; }