if (!
$entity->
access('view'
) &&
$entity->
access('view label'
) &&
$field_access instanceof AccessResultReasonInterface &&
empty($field_access->
getReason())) { $field_access->
setReason("The user only has authorization for the 'view label' operation."
);
} $via_link = Url::
fromRoute( sprintf('jsonapi.%s.%s.related',
$entity->
getEntityTypeId() . '--' .
$entity->
bundle(),
$public_field_name),
['entity' =>
$entity->
uuid()] );
$collected_responses[] =
static::
getAccessDeniedResponse($entity,
$field_access,
$via_link,
$field_name, 'The current user is not allowed to view this relationship.',
$field_name);
break;
} if ($target_entity =
$entity->
{$field_name}->entity
) { $target_access =
static::
entityAccess($target_entity, 'view',
$this->account
);
if (!
$target_access->
isAllowed()) { $target_access =
static::
entityAccess($target_entity, 'view label',
$this->account
)->
addCacheableDependency($target_access);
} if (!
$target_access->
isAllowed()) { $resource_identifier =
static::
toResourceIdentifier($target_entity);
if (!
static::
collectionHasResourceIdentifier($resource_identifier,
$data['already_checked'
])) { $data['already_checked'
][] =
$resource_identifier;
$via_link = Url::
fromRoute( sprintf('jsonapi.%s.individual',
$resource_identifier['type'
]),
['entity' =>
$resource_identifier['id'
]] );