elseif ($field_definition->
getName() ===
$this->entityType->
getKey('uuid'
)) { // UUIDs can be set when creating an entity.
if (!
$entity->
isNew()) { return $return_as_object ? AccessResult::
forbidden('The entity UUID cannot be changed.'
)->
addCacheableDependency($entity) : FALSE;
} } } // Get the default access restriction as specified by the access control
// handler.
$entity_default =
$this->
checkFieldAccess($operation,
$field_definition,
$account,
$items);
// Combine default access, denying access wins.
$default =
$default->
andIf($entity_default);
// Invoke hook and collect grants/denies for field access from other
// modules.
$grants =
[];
$this->
moduleHandler()->
invokeAllWith( 'entity_field_access',
function Dcallable
$hook, string
$module) use ($operation,
$field_definition,
$account,
$items, &
$grants) { $grants[] =
[$module =>
$hook($operation,
$field_definition,
$account,
$items)];
}