public function capabilitiesAction()
    {
        $routes = $this->router->getRouteCollection();
        $exposed = [];

        foreach ($routes as $name => $route) {
            if (!$route->hasDefault(RouteKeys::DEFINITION)) {
                continue;
            }

            if (!in_array('OPTIONS', $route->getMethods(), true)) {
                continue;
            }

            $definition = $route->getDefault(RouteKeys::DEFINITION);
            list($collection, $resource) = explode('::', $definition);
            $definition = $this
                ->registry
                ->getCollection($collection)
                ->getResource($resource);

            if ($definition->hasOption('private')) {
                continue;
            }

            $exposed[$name] = $route;
        }

        return $exposed;
    }