Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
made security optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Aug 1, 2012
1 parent 9ffd5a1 commit e9f7783
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Controller/DoctrineController.php
Expand Up @@ -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;
Expand All @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion Resources/config/orm.xml
Expand Up @@ -7,10 +7,10 @@
<services>

<service id="liip_vie.orm.controller" class="Liip\VieBundle\Controller\ORMController">
<argument type="service" id="security.context"/>
<argument type="service" id="fos_rest.view_handler"/>
<argument type="service" id="validator"/>
<argument type="service" id="doctrine"/>
<argument type="service" id="security.context" on-invalid="ignore"/>
<argument type="service" id="liip_vie.filter"/>
<argument>null</argument>
</service>
Expand Down
1 change: 0 additions & 1 deletion Resources/config/phpcr.xml
Expand Up @@ -7,7 +7,6 @@
<services>

<service id="liip_vie.phpcr.controller" class="Liip\VieBundle\Controller\PhpcrController">
<argument type="service" id="security.context"/>
<argument type="service" id="fos_rest.view_handler"/>
<argument type="service" id="doctrine_phpcr"/>
<argument>null</argument>
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/phpcr_odm.xml
Expand Up @@ -7,10 +7,10 @@
<services>

<service id="liip_vie.phpcr_odm.controller" class="Liip\VieBundle\Controller\PhpcrOdmController">
<argument type="service" id="security.context"/>
<argument type="service" id="fos_rest.view_handler"/>
<argument type="service" id="validator"/>
<argument type="service" id="doctrine_phpcr"/>
<argument type="service" id="security.context" on-invalid="ignore"/>
<argument type="service" id="liip_vie.filter" on-invalid="ignore" />
<argument>null</argument>
</service>
Expand Down

0 comments on commit e9f7783

Please sign in to comment.