Skip to content

Commit a1f10a3

Browse files
author
Iltar van der Berg
committed
s Fixed versionadds based on feedback
1 parent dba4edf commit a1f10a3

File tree

9 files changed

+35
-21
lines changed

9 files changed

+35
-21
lines changed

book/security.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,8 @@ authorization from inside a controller::
11871187
The ``createAccessDeniedException`` method was introduced in Symfony 2.5.
11881188

11891189
.. versionadded:: 2.6
1190-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
1190+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
1191+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
11911192

11921193
The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::createAccessDeniedException`
11931194
method creates a special :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
@@ -1607,7 +1608,8 @@ look like::
16071608
}
16081609

16091610
.. versionadded:: 2.6
1610-
Service ``security.token_storage`` replaces ``security.context`` for ``getToken`` as of 2.6.
1611+
The ``security.token_storage`` service was introduced in Symfony 2.6. Prior
1612+
to Symfony 2.6, you had to use the ``getToken()`` method of the ``security.context`` service.
16111613

16121614
In a controller this can be shortcut to:
16131615

@@ -1884,7 +1886,8 @@ authorization from inside a controller::
18841886
}
18851887

18861888
.. versionadded:: 2.6
1887-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
1889+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
1890+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
18881891

18891892
.. caution::
18901893

@@ -1919,7 +1922,8 @@ accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object::
19191922
}
19201923

19211924
.. versionadded:: 2.6
1922-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
1925+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
1926+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
19231927

19241928
In this example, if the current user has ``ROLE_ADMIN`` or if the current
19251929
user object's ``isSuperAdmin()`` method returns ``true``, then access will
@@ -1966,10 +1970,10 @@ Additionally, you have access to a number of functions inside the expression:
19661970
use Symfony\Component\ExpressionLanguage\Expression;
19671971
// ...
19681972

1969-
$ac = $this->get('security.authorization_checker');
1970-
$access1 = $ac->isGranted('IS_AUTHENTICATED_REMEMBERED');
1973+
$authorizationChecker = $this->get('security.authorization_checker');
1974+
$access1 = $authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED');
19711975

1972-
$access2 = $ac->isGranted(new Expression(
1976+
$access2 = $authorizationChecker->isGranted(new Expression(
19731977
'is_remember_me() or is_fully_authenticated()'
19741978
));
19751979

book/templating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ automatically:
11561156
<?php endif; ?>
11571157

11581158
.. versionadded:: 2.6
1159-
The security context is deprecated as of 2.6 as the user is already available
1159+
The ``app.security`` is deprecated as of 2.6. The user is already available
11601160
as ``app.user`` and ``is_granted()`` is registered as function.
11611161

11621162
.. tip::

components/security/authentication.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ firewall map is able to extract the user's credentials from the current
1010
a token, containing these credentials. The next thing the listener should
1111
do is ask the authentication manager to validate the given token, and return
1212
an *authenticated* token if the supplied credentials were found to be valid.
13-
The listener should then store the authenticated token in the token storage::
13+
The listener should then store the authenticated token using the token storage::
1414

1515
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
1616
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@@ -59,7 +59,9 @@ The listener should then store the authenticated token in the token storage::
5959
}
6060

6161
.. versionadded:: 2.6
62-
Class ``TokenStorage`` replaces ``SecurityContext`` for ``getToken`` as of 2.6.
62+
The :class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface` was
63+
introduced in Symfony 2.6. Prior, you had to use the ``getToken()`` method of
64+
:class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`.
6365

6466
.. note::
6567

components/security/firewall.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ certain action or resource of the application::
3131
}
3232

3333
.. versionadded:: 2.6
34-
The ``SecurityContext`` is deprecated of 2.6 and is replaced by the ``AuthorizationChecker``
35-
and ``TokenStorage``.
36-
34+
As of Symfony 2.6, the :class:`Symfony\\Component\\Security\\Core\\SecurityContext` class was split
35+
in the :class:`Symfony\\Component\\Security\\Core\\Authentication\\Authorization\\AuthorizationChecker` and
36+
:class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage` classes.
3737

3838
.. note::
3939

cookbook/form/dynamic_form_modification.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ and fill in the listener logic::
337337
}
338338

339339
.. versionadded:: 2.6
340-
``TokenStorageInterface`` replaces ``SecurityContext`` for ``getToken`` as of 2.6.
340+
The :class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface` was
341+
introduced in Symfony 2.6. Prior, you had to use the ``getToken()`` method of
342+
:class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`.
341343

342344
.. note::
343345

cookbook/profiler/matchers.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ something like::
9090
}
9191

9292
.. versionadded:: 2.6
93-
Class ``AuthorizationChecker`` replaces ``SecurityContext`` for ``isGranted`` as of 2.6.
93+
The :class:`Symfony\\Component\\Security\\Core\\Authentication\\Authorization\\AuthorizationCheckerInterface` was
94+
introduced in Symfony 2.6. Prior, you had to use the ``isGranted`` method of
95+
:class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`.
9496

9597
Then, you need to configure the service:
9698

@@ -136,7 +138,8 @@ Then, you need to configure the service:
136138
);
137139
138140
.. versionadded:: 2.6
139-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
141+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
142+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
140143

141144
Now the service is registered, the only thing left to do is configure the
142145
profiler to use this service as the matcher:

cookbook/security/remember_me.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ In the following example, the action is only allowed if the user has the
172172
}
173173
174174
.. versionadded:: 2.6
175-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
175+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
176+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
176177

177178
You can also choose to install and use the optional JMSSecurityExtraBundle_,
178179
which can secure your controller using annotations:

cookbook/security/securing_services.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ and checking the current user's role::
2222
}
2323

2424
.. versionadded:: 2.6
25-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
25+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
26+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
2627

2728
You can also secure *any* service in a similar way by injecting the ``security.authorization_checker``
2829
service into it. For a general introduction to injecting dependencies into
@@ -189,7 +190,7 @@ the :ref:`sidebar <securing-services-annotations-sidebar>` below):
189190
190191
$definition = new Definition(
191192
'%newsletter_manager.class%',
192-
array(new Reference('...'))
193+
// ...
193194
));
194195
$definition->addTag('security.secure_service');
195196
$container->setDefinition('newsletter_manager', $definition);

cookbook/security/voters_data_permission.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ from the authorization checker is called.
222222
}
223223
224224
.. versionadded:: 2.6
225-
Service ``security.authorization_checker`` replaces ``security.context`` for ``isGranted`` as of 2.6.
226-
225+
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
226+
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
227+
227228
It's that easy!

0 commit comments

Comments
 (0)