@@ -10,17 +10,28 @@ steps in the process of authenticating the user have been taken successfully,
1010you can ask the security context if the authenticated user has access to a
1111certain action or resource of the application::
1212
13- use Symfony\Component\Security\SecurityContext;
13+ use Symfony\Component\Security\Core\ SecurityContext;
1414 use Symfony\Component\Security\Core\Exception\AccessDeniedException;
15+
16+ // instance of Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface
17+ $authenticationManager = ...;
1518
16- $securityContext = new SecurityContext();
19+ // instance of Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface
20+ $accessDecisionManager = ...;
21+
22+ $securityContext = new SecurityContext($authenticationManager, $accessDecisionManager);
1723
1824 // ... authenticate the user
1925
2026 if (!$securityContext->isGranted('ROLE_ADMIN')) {
2127 throw new AccessDeniedException();
2228 }
2329
30+ ..note ::
31+
32+ Read the dedicated sections to learn more about:doc: `/components/security/authentication `
33+ and:doc: `/components/security/authorization `.
34+
2435.. _firewall :
2536
2637A Firewall for HTTP Requests