Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit9a6f242

Browse files
committed
Merge branch '2.3' into 2.5
* 2.3: Typo Fix: "allows to" should be "allows you to" bump required PHPUnit version remove @Security annotation for Symfony 2.3Conflicts:best_practices/security.rst
2 parents3a25b1d +5940d52 commit9a6f242

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

‎best_practices/security.rst

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,13 @@ 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>`, the
78-
:ref:`@Security annotation<best-practices-security-annotation>` and using
79-
:ref:`isGranted<best-practices-directly-isGranted>` on the ``security.context``
77+
configuration in:doc:`security.yml</reference/configuration/security>` and
78+
using:ref:`isGranted<best-practices-directly-isGranted>` on the ``security.context``
8079
service directly.
8180

8281
..best-practice::
8382

8483
* For protecting broad URL patterns, use ``access_control``;
85-
* Whenever possible, use the ``@Security`` annotation;
8684
* Check security directly on the ``security.context`` service whenever
8785
you have a more complex situation.
8886

@@ -208,14 +206,13 @@ Now you can reuse this method both in the template and in the security expressio
208206
{% endif %}
209207

210208
.. _best-practices-directly-isGranted:
209+
.. _checking-permissions-without-security:
211210

212-
Checking Permissions without @Security
213-
--------------------------------------
211+
ManuallyChecking Permissions
212+
-----------------------------
214213

215-
The above example with ``@Security`` only works because we're using the
216-
:ref:`ParamConverter<best-practices-paramconverter>`, which gives the expression
217-
access to the a ``post`` variable. If you don't use this, or have some other
218-
more advanced use-case, you can always do the same security check in PHP:
214+
If you cannot control the access based on URL patterns, you can always do
215+
the security checks in PHP:
219216

220217
..code-block::php
221218
@@ -303,21 +300,7 @@ To enable the security voter in the application, define a new service:
303300
tags:
304301
-{ name: security.voter }
305302
306-
Now, you can use the voter with the ``@Security`` annotation:
307-
308-
..code-block::php
309-
310-
/**
311-
* @Route("/{id}/edit", name="admin_post_edit")
312-
* @Security("is_granted('edit', post)")
313-
*/
314-
public function editAction(Post $post)
315-
{
316-
// ...
317-
}
318-
319-
You can also use this directly with the ``security.context`` service or via
320-
the even easier shortcut in a controller:
303+
Now, you can use the voter with the ``security.context`` service:
321304

322305
..code-block::php
323306

‎book/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ it has its own excellent `documentation`_.
1717

1818
..note::
1919

20-
Symfony works with PHPUnit 3.5.11 or later, though version3.6.4 is
21-
neededto test the Symfony core code itself.
20+
It's recommended to use the latest stable PHPUnit version(you will have
21+
to use version 4.2 or higherto test the Symfony core code itself).
2222

2323
Each test - whether it's a unit test or a functional test - is a PHP class
2424
that should live in the ``Tests/`` subdirectory of your bundles. If you follow

‎cookbook/logging/monolog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ easily. Your formatter must implement
220220
Adding some extra Data in the Log Messages
221221
------------------------------------------
222222

223-
Monolog allows to process the record before logging it to add some
223+
Monolog allowsyouto process the record before logging it to add some
224224
extra data. A processor can be applied for the whole handler stack or
225225
only for a specific handler.
226226

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp