Skip to content
Snippets Groups Projects
Commit a71080e6 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2267411 by David_Rothstein | klausi: Document that field_access() does...

Issue #2267411 by David_Rothstein | klausi: Document that field_access() does no entity access checks.
parent 5cdf2cce
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -74,6 +74,11 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler); ...@@ -74,6 +74,11 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler);
/** /**
* Checks access to an operation on a given entity field. * Checks access to an operation on a given entity field.
* *
* This method does not determine whether access is granted to the entity
* itself, only the specific field. Callers are responsible for ensuring that
* entity access is also respected, for example by using
* \Drupal\Core\Entity\EntityAccessControllerInterface::access().
*
* @param string $operation * @param string $operation
* The operation access should be checked for. * The operation access should be checked for.
* Usually one of "view" or "edit". * Usually one of "view" or "edit".
...@@ -86,6 +91,8 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler); ...@@ -86,6 +91,8 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler);
* (optional) The field values for which to check access, or NULL if access * (optional) The field values for which to check access, or NULL if access
* is checked for the field definition, without any specific value * is checked for the field definition, without any specific value
* available. Defaults to NULL. * available. Defaults to NULL.
*
* @see \Drupal\Core\Entity\EntityAccessControllerInterface::access()
*/ */
public function fieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account = NULL, FieldItemListInterface $items = NULL); public function fieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account = NULL, FieldItemListInterface $items = NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment