if (!
$context->
isAllowed($privilege)) { $missingPrivileges[] =
$privilege;
} $definition =
$this->definitionInstanceRegistry->
getByEntityName($sourceEntity);
$mappings =
$profile->
getMapping() ??
[];
$mappedKeys =
array_column($mappings, 'key'
);
$propertyPaths =
array_map(fn (string
$key): array =>
explode('.',
$key),
$mappedKeys);
foreach ($propertyPaths as $properties) { $missingPrivileges =
$this->
getMissingPrivilges($properties,
$definition,
$context,
$missingPrivileges);
} if (!
empty($missingPrivileges)) { throw new MissingPrivilegeException($missingPrivileges);
} } /**
* @param array<string> $properties
* @param array<string> $missingPrivileges
*
* @return array<string>
*/