private function prepareRoleCollection (array $roleConfiguration)
    {
        /** @var Role[] $preparedRoles */
        $preparedRoles = [];

        foreach ($roleConfiguration as $roleKey => $configuration)
        {
            $preparedRoles[$roleKey] = Role::createFromConfiguration($roleKey, $configuration);
        }

        // Transform the Actions to Roles
        foreach ($roleConfiguration as $roleKey => $configuration)
        {
            if (!isset($configuration["actions"]) || !is_array($configuration["actions"]))
            {
                continue;
            }

            foreach ($configuration["actions"] as $action)
            {
                if (!isset($preparedRoles[$action]))
                {
                    $preparedRoles[$action] = new BaseRole($action);
                }
            }

            $includedActions = array_map(
                function ($role) use ($preparedRoles)
                {
                    return $preparedRoles[$role];
                },
                $configuration["actions"]
            );

            $preparedRoles[$roleKey]->setIncludedActions($includedActions);
        }

        foreach ($roleConfiguration as $roleKey => $configuration)
        {
            if (!isset($configuration["included_roles"]) || !is_array($configuration["included_roles"]))
            {
                continue;
            }

            $includedRoles = array_map(
                function ($role) use ($preparedRoles)
                {
                    return $preparedRoles[$role];
                },
                $configuration["included_roles"]
            );

            $preparedRoles[$roleKey]->setIncludedRoles($includedRoles);
        }

        return $preparedRoles;
    }