Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2035d62

Browse filesBrowse files
committed
Updating for new security service names in 2.6
1 parent 4166339 commit 2035d62
Copy full SHA for 2035d62

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎cookbook/controller/service.rst

Copy file name to clipboardExpand all lines: cookbook/controller/service.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ controller:
273273

274274
*Simply inject doctrine instead of fetching it from the container*
275275

276-
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getUser` (service: ``security.context``)
276+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getUser` (service: ``security.token_storage``)
277277
.. code-block:: php
278278
279279
$user = null;
280-
$token = $securityContext->getToken();
280+
$token = $tokenStorage->getToken();
281281
if (null !== $token && is_object($token->getUser())) {
282282
$user = $token->getUser();
283283
}
284284
285-
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isGranted` (service: ``security.context``)
285+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isGranted` (service: ``security.authorization_checker``)
286286
.. code-block:: php
287287
288-
$securityContext->isGranted($attributes, $object);
288+
$authChecker->isGranted($attributes, $object);
289289
290290
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::redirect`
291291
.. code-block:: php

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.