Skip to content

Commit 4143076

Browse files
committed
minor #4872 [BestPractices] fix merge after removing @Security in 2.3 (xabbuh)
This PR was merged into the 2.5 branch. Discussion ---------- [BestPractices] fix merge after removing @Security in 2.3 | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5+ | Fixed tickets | Commits ------- 5c55491 fix merge after removing @Security in 2.3
2 parents 240a981 + 5c55491 commit 4143076

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

best_practices/security.rst

+7-4
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ Authorization (i.e. Denying Access)
7474
-----------------------------------
7575

7676
Symfony gives you several ways to enforce authorization, including the ``access_control``
77-
configuration in :doc:`security.yml </reference/configuration/security>` and
78-
using :ref:`isGranted <best-practices-directly-isGranted>` on the ``security.context``
77+
configuration in :doc:`security.yml </reference/configuration/security>`, the
78+
:ref:`@Security annotation <best-practices-security-annotation>` and using
79+
:ref:`isGranted <best-practices-directly-isGranted>` on the ``security.context``
7980
service directly.
8081

8182
.. best-practice::
8283

8384
* For protecting broad URL patterns, use ``access_control``;
85+
* Whenever possible, use the ``@Security`` annotation;
8486
* Check security directly on the ``security.context`` service whenever
8587
you have a more complex situation.
8688

@@ -207,9 +209,10 @@ Now you can reuse this method both in the template and in the security expressio
207209

208210
.. _best-practices-directly-isGranted:
209211
.. _checking-permissions-without-security:
212+
.. _manually-checking-permissions:
210213

211-
Manually Checking Permissions
212-
-----------------------------
214+
Checking Permissions without @Security
215+
--------------------------------------
213216

214217
The above example with ``@Security`` only works because we're using the
215218
:ref:`ParamConverter <best-practices-paramconverter>`, which gives the expression

0 commit comments

Comments
 (0)