Replaces local role identifiers ("SomeRole") by their global representation ("Current.Package:SomeRole")
and sets "parentRoles"

@param array $configuration
@return void
519629
public function processRoles(array &$configuration)
    {
        if (!isset($configuration['roles'])) {
            return;
        }
        $newRolesConfiguration = array();
        foreach ($configuration['roles'] as $roleIdentifier => $roleConfiguration) {
            $roleIdentifier = $this->expandRoleIdentifier($roleIdentifier);
            $newRolesConfiguration[$roleIdentifier] = array();
            if (!is_array($roleConfiguration) || $roleConfiguration === array()) {
                continue;
            }
            if (isset($roleConfiguration['privileges'])) {
                $newRolesConfiguration[$roleIdentifier] = $roleConfiguration;
                continue;
            }
            $newRolesConfiguration[$roleIdentifier]['parentRoles'] = array();
            foreach ($roleConfiguration as $parentRoleIdentifier) {
                if (strpos($parentRoleIdentifier, ':') === false) {
                    $parentRoleIdentifier = $this->expandRoleIdentifier($parentRoleIdentifier);
                }
                $newRolesConfiguration[$roleIdentifier]['parentRoles'][] = $parentRoleIdentifier;
            }
        }
        $configuration['roles'] = $newRolesConfiguration;
    }
990401
protected function sanitize(array $configuration)
    {
        foreach ($configuration as $key => $config) {
            if (null === $config['name']) {
                $configuration[$key]['name'] = $this->defaultRouteName($key);
            }
            if (null === $config['path']) {
                $configuration[$key]['path'] = $this->defaultRoutePath($key);
            }
            if (null === $config['api_name']) {
                $configuration[$key]['api_name'] = $this->defaultApiRouteName($key);
            }
            if (null === $config['api_path']) {
                $configuration[$key]['api_path'] = $this->defaultApiRoutePath($key);
            }
        }

        return $configuration;
    }
9474
public function setConfiguration($configuration)
    {
        $this->configuration = (string) $configuration;

        $message = sprintf("Set configuration to [%s].", $this->configuration);
        $this->log($message, Project::MSG_DEBUG);
    }
984513
private function handleConfiguration($configuration)
    {
        $tensideConfig = $this->get('tenside.config');

        if (isset($configuration['php_cli'])) {
            $tensideConfig->setPhpCliBinary($configuration['php_cli']);
        }

        if (isset($configuration['php_cli_arguments'])) {
            $tensideConfig->setPhpCliArguments($configuration['php_cli_arguments']);
        }

        if (isset($configuration['php_cli_environment'])) {
            $tensideConfig->setPhpCliEnvironment($configuration['php_cli_environment']);
        }

        if (isset($configuration['php_force_background'])) {
            $tensideConfig->setForceToBackground($configuration['php_force_background']);
        }

        if (isset($configuration['php_can_fork'])) {
            $tensideConfig->setForkingAvailable($configuration['php_can_fork']);
        }

        if (isset($configuration['github_oauth_token'])) {
            $composerAuth = new AuthJson(
                $this->get('tenside.home')->tensideDataDir() . DIRECTORY_SEPARATOR . 'auth.json',
                null
            );

            $composerAuth->setGithubOAuthToken($configuration['github_oauth_token']);
        }
    }
747465
public function addConfiguration(ConfigurationInterface $configuration)
    {
        // Clear the parent map.
        $this->parentMap = null;

        $id = $configuration->getResourceId();

        if (array_key_exists($id, $this->configurations)) {
            throw new \RuntimeException(sprintf("Configuration for resource '%s' is already registered.", $id));
        }

        $this->configurations[$id] = $configuration;
    }
422826
public function inherits(string ...$roles)
    {
        foreach ($roles as $role)
        {
            if (!$this->roleRegistry->exists($role)) {
                throw new \Exception(
                    sprintf(
                        "The role: %s doesnt exist",
                        (string)$role
                    )
                );
            }

            $this->roleRegistry->setRegistryValue($this->session["role"], $role);
        }

        $this->initSession();
    }
80945
public function setNewDatabase($configuration): void
    {
        if ($configuration instanceof Configurator) {
            $this->db = new Db($configuration);
        } else {
            $this->db = new Db(new Configurator($configuration));
        }
    }
1235448
public function setConfiguration($configuration)
	{
		if(is_array($configuration) or is_object($configuration))
			foreach($configuration as $name => $value)
			{
				$this->{$name} = $value;
			}
	}
590711
public function setConfig($aliasOrClass, array $configuration, $append = false)
        {
            $key = ($this->hasAlias($aliasOrClass)) ? 'alias:' . $this->getBaseAlias($aliasOrClass) : $aliasOrClass;

            if (!isset($this->configurations[$key]) || !$append) {
                $this->configurations[$key] = $this->configurationTemplate;
            }
            // Ignore anything but 'parameters' and 'injections'
            $configuration = [
                'parameters' => isset($configuration['parameters']) ? $configuration['parameters'] : [],
                'injections' => isset($configuration['injections']) ? $configuration['injections'] : [],
                'shared'     => isset($configuration['shared'])     ? $configuration['shared']     : true
            ];

            $this->configurations[$key] = array_replace_recursive($this->configurations[$key], $configuration);
        }
1038821
public function setRoles($roles)
    {
        $widget = $this->widget;
        $newRoles = [];
        foreach ($this->availableRoles as $role) {
            $newRoles[$role] = in_array($role, $roles);
        }
        $widget->setOption('roles', $newRoles);
    }
222895
private function parseHostedConfiguration(array $configuration, ContainerBuilder $container)
    {
        $entityId = ['entity_id_route' => $configuration['metadata']['entity_id_route']];
        $serviceProvider  = array_merge($configuration['service_provider'], $entityId);
        $identityProvider = array_merge($configuration['identity_provider'], $entityId);

        $container
            ->getDefinition('surfnet_saml.saml.attribute_dictionary')
            ->replaceArgument(0, $configuration['attribute_dictionary']['ignore_unknown_attributes']);

        $this->parseHostedSpConfiguration($serviceProvider, $container);
        $this->parseHostedIdpConfiguration($identityProvider, $container);
        $this->parseMetadataConfiguration($configuration, $container);
    }
793656
public function addRole(string $role, ?array $parents = null): void
    {
        $this->roles[] = $role;
        
        if(null !== $parents) {
            $map = [];
            foreach ($parents as $parent) {
                $map[] = $parent;
                $map = \array_merge($map, $this->getRoles($parent));
            }
            unset($map[0]);
            
            $this->map[$role] = \array_values(\array_unique($map));
        }
    }
406805
public function setRoles(Collection $roles)
    {
        $this->roles->clear();
        foreach ($roles as $role) {
            $this->roles[] = $role;
        }
    }
580637
protected function removeUndeclaredTypes(array &$configuration)
    {
        foreach ($configuration as $index => $type) {
            if (!isset($this->types[$type])) {
                unset($configuration[$index]);
            }
        }
    }
689346
public function addConfiguration(SecurityConfigurationInterface $configuration)
    {
        if (isset($this->configurations[$configuration->getName()])) {
            throw new ConfigurationException(sprintf('Configuration "%s" already added.', $configuration->getName()));
        }

        $this->configurations[$configuration->getName()] = $configuration;
    }
1057059
protected function initialize(array $configuration)
    {
        if (array_key_exists(self::WURFL, $configuration)) {
            $this->setWurflConfiguration($configuration[self::WURFL]);
        }

        if (array_key_exists(self::PERSISTENCE, $configuration)) {
            $this->persistence = $this->buildPersistenceConfiguration($configuration[self::PERSISTENCE]);
        }

        if (array_key_exists(self::CACHE, $configuration)) {
            $this->cache = $this->buildPersistenceConfiguration($configuration[self::CACHE]);
        }

        if (array_key_exists(self::CAPABILITY_FILTER, $configuration)) {
            $this->capabilityFilter = $configuration[self::CAPABILITY_FILTER];
        }

        if (array_key_exists(self::MATCH_MODE, $configuration)) {
            $this->setMatchMode($configuration[self::MATCH_MODE]);
        }

        if (array_key_exists(self::LOGGER, $configuration)) {
            $this->buildLoggerConfiguration($configuration[self::LOGGER]);
        } elseif (array_key_exists(self::LOG_DIR, $configuration)) {
            $this->buildFileLogger($configuration[self::LOG_DIR]);
        }

        $this->allowReload = array_key_exists(self::ALLOW_RELOAD, $configuration)
            ? (boolean) $configuration[self::ALLOW_RELOAD] : false;
    }
944104
public function configure(array $configuration)
    {
        // allows to use the default options when a null value is passed
        if (array_key_exists('options', $configuration) && $configuration['options'] === null) {
            unset($configuration['options']);
        }

        $optionsResolver = new OptionsResolver();
        $optionsResolver
            ->setDefined(['host', 'database', 'options', 'driver_options'])
            ->setDefaults([
                'options' => ['connect' => false],
                'driver_options' => ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']],
            ])
            ->setRequired(['host', 'database'])
            ->setAllowedTypes('host', 'string')
            ->setAllowedTypes('database', 'string')
            ->setAllowedTypes('options', 'array')
            ->setAllowedTypes('driver_options', 'array')
        ;

        try {
            $this->configuration = $optionsResolver->resolve($configuration);
        } catch (\Exception $e) {
            throw new NoSQLDriverException('Wrong configuration: '.$e->getMessage(), $e->getCode(), $e);
        }
    }