Navigation Menu

Skip to content

Commit

Permalink
[FrameworkBundle] Update deprecated service call
Browse files Browse the repository at this point in the history
The service `security.context` is now deprecated due to PR #11690.

This commit updates PR #11593 replacing `security.context` with
`security.authorization_checker` in the `isGranted()` controller
shortcut.
  • Loading branch information
lrlopez committed Nov 30, 2014
1 parent 309de6d commit 2625193
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Expand Up @@ -123,11 +123,11 @@ protected function addFlash($type, $message)
*/
protected function isGranted($attributes, $object = null)
{
if (!$this->container->has('security.context')) {
if (!$this->container->has('security.authorization_checker')) {
throw new \LogicException('The SecurityBundle is not registered in your application.');
}

return $this->container->get('security.context')->isGranted($attributes, $object);
return $this->container->get('security.authorization_checker')->isGranted($attributes, $object);
}

/**
Expand Down

0 comments on commit 2625193

Please sign in to comment.