Skip to content

Commit 82bdf2f

Browse files
committed
Replace former SecurityContext argument by TokenStorage
1 parent e07a221 commit 82bdf2f

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
@@ -204,15 +204,17 @@ which contains request matchers and a corresponding set of attributes that
204204
are required for the current user to get access to the application::
205205

206206
use Symfony\Component\Security\Http\AccessMap;
207+
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
207208
use Symfony\Component\HttpFoundation\RequestMatcher;
208209
use Symfony\Component\Security\Http\Firewall\AccessListener;
209210

210211
$accessMap = new AccessMap();
212+
$tokenStorage = new TokenStorage();
211213
$requestMatcher = new RequestMatcher('^/admin');
212214
$accessMap->add($requestMatcher, array('ROLE_ADMIN'));
213215

214216
$accessListener = new AccessListener(
215-
$securityContext,
217+
$tokenStorage,
216218
$accessDecisionManager,
217219
$accessMap,
218220
$authenticationManager

0 commit comments

Comments
 (0)