diff --git a/Controller/DoctrineController.php b/Controller/DoctrineController.php index 73ac0ce..99fe808 100755 --- a/Controller/DoctrineController.php +++ b/Controller/DoctrineController.php @@ -52,7 +52,7 @@ abstract class DoctrineController */ protected $name; - public function __construct(SecurityContextInterface $securityContext, ViewHandlerInterface $viewHandler, ValidatorInterface $validator, ManagerRegistry $registry, FilterInterface $filter = null, $name = null) + public function __construct(ViewHandlerInterface $viewHandler, ValidatorInterface $validator, ManagerRegistry $registry, SecurityContextInterface $securityContext = null, FilterInterface $filter = null, $name = null) { $this->securityContext = $securityContext; $this->viewHandler = $viewHandler; @@ -75,7 +75,7 @@ protected function getManager() */ public function putDocumentAction(Request $request, $id) { - if (false === $this->securityContext->isGranted("IS_AUTHENTICATED_ANONYMOUSLY")) { + if ($this->securityContext && false === $this->securityContext->isGranted("IS_AUTHENTICATED_ANONYMOUSLY")) { throw new AccessDeniedException(); } diff --git a/Resources/config/orm.xml b/Resources/config/orm.xml index 7ed2f70..1215e31 100755 --- a/Resources/config/orm.xml +++ b/Resources/config/orm.xml @@ -7,10 +7,10 @@ - + null diff --git a/Resources/config/phpcr.xml b/Resources/config/phpcr.xml index baba00e..e3168fc 100644 --- a/Resources/config/phpcr.xml +++ b/Resources/config/phpcr.xml @@ -7,7 +7,6 @@ - null diff --git a/Resources/config/phpcr_odm.xml b/Resources/config/phpcr_odm.xml index 4acb301..b50afe2 100755 --- a/Resources/config/phpcr_odm.xml +++ b/Resources/config/phpcr_odm.xml @@ -7,10 +7,10 @@ - + null