processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); $loader->load('services.yaml'); $loader->load('services/controller.yaml'); $loader->load('services/form.yaml'); $loader->load('services/security.yaml'); $loader->load('services/3partytype.yaml'); $loader->load('services/search.yaml'); $loader->load('services/templating.yaml'); $loader->load('services/menu.yaml'); $loader->load('services/fixtures.yaml'); $loader->load('services/serializer.yaml'); } public function prepend(ContainerBuilder $container) { $this->preprendRoutes($container); $this->prependRoleHierarchy($container); } protected function preprendRoutes(ContainerBuilder $container) { //declare routes for 3party bundle $container->prependExtensionConfig('chill_main', array( 'routing' => [ 'resources' => array( '@ChillThirdPartyBundle/config/routes.yaml' ) ], 'apis' => [ [ 'class' => \Chill\ThirdPartyBundle\Entity\ThirdParty::class, 'name' => 'thirdparty', 'base_path' => '/api/1.0/thirdparty/thirdparty', //'base_role' => \Chill\ThirdPartyBundle\Security\Authorization\ThirdPartyVoter::SHOW, //'controller' => \Chill\ThirdPartyBundle\Controller\ThirdPartyApiController::class, 'actions' => [ '_entity' => [ 'methods' => [ Request::METHOD_GET => true, Request::METHOD_HEAD => true, Request::METHOD_POST => true, Request::METHOD_PUT => true, Request::METHOD_PATCH => true ], 'roles' => [ Request::METHOD_GET => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, Request::METHOD_HEAD => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, Request::METHOD_POST => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, Request::METHOD_PUT => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, Request::METHOD_PATCH => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE ], ] ] ] ], )); } protected function prependRoleHierarchy(ContainerBuilder $container) { $container->prependExtensionConfig('security', array( 'role_hierarchy' => array( ThirdPartyVoter::CREATE => [ThirdPartyVoter::SHOW], ThirdPartyVoter::UPDATE => [ThirdPartyVoter::SHOW], ) )); } }