diff --git a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php index 036a50722..01ce4d9f7 100644 --- a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php +++ b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php @@ -17,6 +17,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\DependencyInjection\Extension; /** @@ -46,6 +47,7 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf $this->prependRoute($container); $this->prependAuthorization($container); $this->prependTwig($container); + $this->prependApis($container); } protected function prependAuthorization(ContainerBuilder $container) @@ -84,4 +86,25 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf ]; $container->prependExtensionConfig('twig', $twigConfig); } + + protected function prependApis(ContainerBuilder $container) + { + $container->prependExtensionConfig('chill_main', [ + 'apis' => [ + [ + 'class' => \Chill\DocStoreBundle\Entity\StoredObject::class, + 'name' => 'stored_object', + 'base_path' => '/api/1.0/docstore/stored-object', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_entity' => [ + 'methods' => [ + Request::METHOD_POST => true, + ], + ], + ], + ], + ] + ]); + } }