8000 minor #12787 [FrameworkBundle] Update deprecated service call (lrlopez) · symfony/symfony@619acd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 619acd2

Browse files
committed
minor #12787 [FrameworkBundle] Update deprecated service call (lrlopez)
This PR was merged into the 2.6 branch. Discussion ---------- [FrameworkBundle] Update deprecated service call | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none, but related to #11593 and #11690 | License | MIT | Doc PR | none 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 introduced in Symfony 2.6. Commits ------- 2625193 [FrameworkBundle] Update deprecated service call
2 parents 5b6a95c + 2625193 commit 619acd2

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 d 8000 eletions
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