From 2625193bd1b8d99fefb5a6fc79b1955d45bd682a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Ram=C3=B3n=20L=C3=B3pez?= Date: Sun, 30 Nov 2014 20:42:36 +0100 Subject: [PATCH] [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. --- src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php index b3c7f42c2ce2..f310b78cc8a3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -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); } /**