8000 [FrameworkBundle] Update deprecated service call · symfony/symfony@2625193 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2625193

Browse files
committed
[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.
1 parent 309de6d commit 2625193

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)
0