protected function createAclFromConfig(array $config)
    {
        $aclConfig     = [];
        $denyByDefault = false;

        if (array_key_exists('deny_by_default', $config)) {
            $denyByDefault = $aclConfig['deny_by_default'] = (bool)$config['deny_by_default'];
            unset($config['deny_by_default']);
        }

        foreach ($config as $controllerService => $privileges) {
            $this->createAclConfigFromPrivileges($controllerService, $privileges, $aclConfig, $denyByDefault);
        }

        return AclFactory::factory($aclConfig);
    }