[FrameworkBundle] Update deprecated service call

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.
This commit is contained in:
Luis Ramón López 2014-11-30 20:42:36 +01:00
parent 309de6dd61
commit 2625193bd1

View File

@ -123,11 +123,11 @@ class Controller extends ContainerAware
*/
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);
}
/**