Skip to content

Commit e174d47

Browse files
committed
Updating one more reference of security.context that I missed in the merge
1 parent 79db0b9 commit e174d47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cookbook/expression/expressions.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object::
3939

4040
public function indexAction()
4141
{
42-
if (!$this->get('security.context')->isGranted(new Expression(
42+
if (!$this->get('security.authorization_checker')->isGranted(new Expression(
4343
'"ROLE_ADMIN" in roles or (user and user.isSuperAdmin())'
4444
))) {
4545
throw $this->createAccessDeniedException();
@@ -99,10 +99,10 @@ Additionally, you have access to a number of functions inside the expression:
9999
use Symfony\Component\ExpressionLanguage\Expression;
100100
// ...
101101

102-
$sc = $this->get('security.context');
103-
$access1 = $sc->isGranted('IS_AUTHENTICATED_REMEMBERED');
102+
$ac = $this->get('security.authorization_checker');
103+
$access1 = $ac->isGranted('IS_AUTHENTICATED_REMEMBERED');
104104

105-
$access2 = $sc->isGranted(new Expression(
105+
$access2 = $ac->isGranted(new Expression(
106106
'is_remember_me() or is_fully_authenticated()'
107107
));
108108

0 commit comments

Comments
 (0)