mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
docstore: add api entrypoint POST for stored object
This commit is contained in:
parent
4655892815
commit
fd29a4ce65
@ -17,6 +17,7 @@ use Symfony\Component\Config\FileLocator;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||||
use Symfony\Component\DependencyInjection\Loader;
|
use Symfony\Component\DependencyInjection\Loader;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,6 +47,7 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
|
|||||||
$this->prependRoute($container);
|
$this->prependRoute($container);
|
||||||
$this->prependAuthorization($container);
|
$this->prependAuthorization($container);
|
||||||
$this->prependTwig($container);
|
$this->prependTwig($container);
|
||||||
|
$this->prependApis($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function prependAuthorization(ContainerBuilder $container)
|
protected function prependAuthorization(ContainerBuilder $container)
|
||||||
@ -84,4 +86,25 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
|
|||||||
];
|
];
|
||||||
$container->prependExtensionConfig('twig', $twigConfig);
|
$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,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user