Skip to content

Commit 6986772

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: [Security] Update access_control.rst [Mailer] Update Twig namespace
2 parents 954a722 + ee05520 commit 6986772

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

mailer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ arguments to the filter:
687687

688688
You can pass unlimited number of arguments to ``inline_css()`` to load multiple
689689
CSS files. For this example to work, you also need to define a new Twig namespace
690-
called ``css`` that points to the directory where ``email.css`` lives:
690+
called ``styles`` that points to the directory where ``email.css`` lives:
691691

692692
.. _mailer-css-namespace:
693693

@@ -810,11 +810,11 @@ You can combine all filters to create complex email messages:
810810

811811
.. code-block:: twig
812812
813-
{% apply inky_to_html|inline_css(source('@css/foundation-emails.css')) %}
813+
{% apply inky_to_html|inline_css(source('@styles/foundation-emails.css')) %}
814814
{# ... #}
815815
{% endapply %}
816816
817-
This makes use of the :ref:`css Twig namespace <mailer-css-namespace>` we created
817+
This makes use of the :ref:`styles Twig namespace <mailer-css-namespace>` we created
818818
earlier. You could, for example, `download the foundation-emails.css file`_
819819
directly from GitHub and save it in ``assets/styles``.
820820

security/access_control.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Take the following ``access_control`` entries as an example:
4343
security:
4444
# ...
4545
access_control:
46-
- { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
4746
- { path: '^/admin', roles: ROLE_USER_PORT, ip: 127.0.0.1, port: 8080 }
47+
- { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
4848
- { path: '^/admin', roles: ROLE_USER_HOST, host: symfony\.com$ }
4949
- { path: '^/admin', roles: ROLE_USER_METHOD, methods: [POST, PUT] }
5050
@@ -70,8 +70,8 @@ Take the following ``access_control`` entries as an example:
7070
7171
<config>
7272
<!-- ... -->
73-
<rule path="^/admin" role="ROLE_USER_IP" ip="127.0.0.1"/>
7473
<rule path="^/admin" role="ROLE_USER_PORT" ip="127.0.0.1" port="8080"/>
74+
<rule path="^/admin" role="ROLE_USER_IP" ip="127.0.0.1"/>
7575
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony\.com$"/>
7676
<rule path="^/admin" role="ROLE_USER_METHOD" methods="POST, PUT"/>
7777
@@ -92,17 +92,17 @@ Take the following ``access_control`` entries as an example:
9292
$container->loadFromExtension('security', [
9393
// ...
9494
'access_control' => [
95-
[
96-
'path' => '^/admin',
97-
'roles' => 'ROLE_USER_IP',
98-
'ips' => '127.0.0.1',
99-
],
10095
[
10196
'path' => '^/admin',
10297
'roles' => 'ROLE_USER_PORT',
10398
'ip' => '127.0.0.1',
10499
'port' => '8080',
105100
],
101+
[
102+
'path' => '^/admin',
103+
'roles' => 'ROLE_USER_IP',
104+
'ips' => '127.0.0.1',
105+
],
106106
[
107107
'path' => '^/admin',
108108
'roles' => 'ROLE_USER_HOST',
@@ -145,13 +145,13 @@ if ``ip``, ``port``, ``host`` or ``method`` are not specified for an entry, that
145145
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
146146
| URI | IP | PORT | HOST | METHOD | ``access_control`` | Why? |
147147
+=================+=============+=============+=============+============+================================+=============================================================+
148-
| ``/admin/user`` | 127.0.0.1 | 80 | example.com | GET | rule #1 (``ROLE_USER_IP``) | The URI matches ``path`` and the IP matches ``ip``. |
148+
| ``/admin/user`` | 127.0.0.1 | 80 | example.com | GET | rule #2 (``ROLE_USER_IP``) | The URI matches ``path`` and the IP matches ``ip``. |
149149
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
150-
| ``/admin/user`` | 127.0.0.1 | 80 | symfony.com | GET | rule #1 (``ROLE_USER_IP``) | The ``path`` and ``ip`` still match. This would also match |
150+
| ``/admin/user`` | 127.0.0.1 | 80 | symfony.com | GET | rule #2 (``ROLE_USER_IP``) | The ``path`` and ``ip`` still match. This would also match |
151151
| | | | | | | the ``ROLE_USER_HOST`` entry, but *only* the **first** |
152152
| | | | | | | ``access_control`` match is used. |
153153
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
154-
| ``/admin/user`` | 127.0.0.1 | 8080 | symfony.com | GET | rule #2 (``ROLE_USER_PORT``) | The ``path``, ``ip`` and ``port`` match. |
154+
| ``/admin/user`` | 127.0.0.1 | 8080 | symfony.com | GET | rule #1 (``ROLE_USER_PORT``) | The ``path``, ``ip`` and ``port`` match. |
155155
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
156156
| ``/admin/user`` | 168.0.0.1 | 80 | symfony.com | GET | rule #3 (``ROLE_USER_HOST``) | The ``ip`` doesn't match the first rule, so the second |
157157
| | | | | | | rule (which matches) is used. |

0 commit comments

Comments
 (0)