@@ -74,13 +74,15 @@ Authorization (i.e. Denying Access)
74
74
-----------------------------------
75
75
76
76
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 ``
79
80
service directly.
80
81
81
82
.. best-practice ::
82
83
83
84
* For protecting broad URL patterns, use ``access_control ``;
85
+ * Whenever possible, use the ``@Security `` annotation;
84
86
* Check security directly on the ``security.context `` service whenever
85
87
you have a more complex situation.
86
88
@@ -207,9 +209,10 @@ Now you can reuse this method both in the template and in the security expressio
207
209
208
210
.. _best-practices-directly-isGranted :
209
211
.. _checking-permissions-without-security :
212
+ .. _manually-checking-permissions :
210
213
211
- Manually Checking Permissions
212
- -----------------------------
214
+ Checking Permissions without @Security
215
+ --------------------------------------
213
216
214
217
The above example with ``@Security `` only works because we're using the
215
218
:ref: `ParamConverter <best-practices-paramconverter >`, which gives the expression
0 commit comments