public function processAcls(array &$configuration)
{
if (!isset($configuration['acls'])) {
return;
}
$newRolesConfiguration = isset($configuration['roles']) ? $configuration['roles'] : array();
foreach ($configuration['acls'] as $roleIdentifier => $aclConfiguration) {
$roleIdentifier = $this->expandRoleIdentifier($roleIdentifier);
if (!isset($newRolesConfiguration[$roleIdentifier])) {
$newRolesConfiguration[$roleIdentifier] = array();
}
if (!isset($newRolesConfiguration[$roleIdentifier]['privileges'])) {
$newRolesConfiguration[$roleIdentifier]['privileges'] = array();
}
foreach ($aclConfiguration as $resourceType => $permissions) {
if ($resourceType !== 'methods' && $resourceType !== 'entities') {
$this->showWarning('Resource type "' . $resourceType . '" is not supported...');
continue;
}
foreach ($permissions as $resourceName => $permission) {
$newRolesConfiguration[$roleIdentifier]['privileges'][] = array('privilegeTarget' => $resourceName, 'permission' => $permission);
}
}
}
unset($configuration['acls']);
$configuration['roles'] = $newRolesConfiguration;
}