Skip to content

Commit aa77378

Browse files
committed
Merge branch '5.0'
* 5.0: Replace former SecurityContext argument by TokenStorage
2 parents 597747b + 1133125 commit aa77378

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/security/authorization.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,17 @@ which contains request matchers and a corresponding set of attributes that
240240
are required for the current user to get access to the application::
241241

242242
use Symfony\Component\HttpFoundation\RequestMatcher;
243+
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
243244
use Symfony\Component\Security\Http\AccessMap;
244245
use Symfony\Component\Security\Http\Firewall\AccessListener;
245246

246247
$accessMap = new AccessMap();
248+
$tokenStorage = new TokenStorage();
247249
$requestMatcher = new RequestMatcher('^/admin');
248250
$accessMap->add($requestMatcher, ['ROLE_ADMIN']);
249251

250252
$accessListener = new AccessListener(
251-
$securityContext,
253+
$tokenStorage,
252254
$accessDecisionManager,
253255
$accessMap,
254256
$authenticationManager

0 commit comments

Comments
 (0)