private function getRouteRoles()
    {
        $router = $this->router;

        $cache = $this->getConfigCacheFactory()->cache(
            $this->options['cache_dir'].'/tenside_roles.php',
            function (ConfigCacheInterface $cache) use ($router) {
                $routes = $router->getRouteCollection();
                $roles  = [];
                foreach ($routes as $name => $route) {
                    if ($requiredRole = $route->getOption('required_role')) {
                        $roles[$name] = $requiredRole;
                    }
                }

                $cache->write('<?php return ' . var_export($roles, true) . ';', $routes->getResources());
            }
        );

        return require_once $cache->getPath();
    }