Skip to content

Commit 7bc4c7c

Browse files
committed
[FrameworkBundle] Update obsolete service call
The service `security.context` is now deprecated due to PR symfony#11690. This commit updates PR symfony#11593 replacing `security.context` with `security.authorization_checker` in the `isGranted()` controller shortcut.
1 parent 309de6d commit 7bc4c7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ protected function addFlash($type, $message)
123123
*/
124124
protected function isGranted($attributes, $object = null)
125125
{
126-
if (!$this->container->has('security.context')) {
126+
if (!$this->container->has('security.authorization_checker')) {
127127
throw new \LogicException('The SecurityBundle is not registered in your application.');
128128
}
129129

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

133133
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy