public function getCollectionAction()
    {
        $application = $this->getApplication();

        $bundles = [];
        
        foreach ($this->getApplication()->getBundles() as $bundle) {
            if ($this->isGranted('EDIT', $bundle) || ($bundle->isEnabled() && $this->isGranted('VIEW', $bundle))) {
                $bundles[] = $bundle;
            }
        }

        return $this->createJsonResponse($bundles, 200, array(
            'Content-Range' => '0-'.(count($bundles) - 1).'/'.count($bundles),
        ));
    }