EntityAccessController documents the invocation of hook_entity_access(), however no hook is ever called.
A generic hook_entity_access should be added which is called for all entities, in the spirit of hook_entity_create/view/presave/load/delete etc.
// Invoke hook_entity_access(), hook results take precedence over overridden
// implementations of EntityAccessController::checkAccess(). Entities
// that have checks that need to be done before the hook is invoked should
// do so by overridding this method.
????? nothing here ?????
// We grant access to the entity if both of these conditions are met:
// - No modules say to deny access.
// - At least one module says to grant access.
$access = module_invoke_all($entity->entityType() . '_access', $entity->getBCEntity(), $operation, $account, $langcode);
- Commit #7dd31494
Implement hook_entity_(create_)access() in addition to the existing hook_ENTITY_TYPE_access() and document hook_ENTITY_TYPE_ACCESS() because it is already being called.
None. Documentation will be fixed and two hooks will be added.
Issues blocked on this
is blocked on this, because field_ui needs to hook into entity access control for any entity type and not just specific ones, in order to check access for the entity operations it defines. This is why a hook_entity_access() is required and hook_ENTITY_TYPE_access() can technically not be used.
PASSED: [[SimpleTest]]: [MySQL] 59,094 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 58,733 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 58,714 pass(es). View