mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
creation api endpoint. Route found, but ajax call still needs to be tested
This commit is contained in:
@@ -8,6 +8,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* This is the class that loads and manages your bundle configuration.
|
||||
@@ -47,11 +48,34 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
|
||||
{
|
||||
//declare routes for 3party bundle
|
||||
$container->prependExtensionConfig('chill_main', array(
|
||||
'routing' => 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::class,
|
||||
'actions' => [
|
||||
'_entity' => [
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true,
|
||||
Request::METHOD_POST=> 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,
|
||||
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user