8000 After backporting something from master (2.5), removing the 2.5-speci… · symfony/symfony-docs@be46c76 · GitHub
[go: up one dir, main page]

Skip to content

Commit be46c76

Browse files
committed
After backporting something from master (2.5), removing the 2.5-specific features
1 parent 9889dbe commit be46c76

File tree

2 files changed

+2
-62
lines changed

2 files changed

+2
-62
lines changed

book/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ can access ``/foo`` without being prompted to authenticate.
183183

184184
.. tip::
185185

186-
You can also match a request against other details of the request (e.g. host, method). For more
187-
information and examples read :doc:`/cookbook/security/firewall_restriction`.
186+
You can also match a request against other details of the request (e.g. host).
187+
For more information and examples read :doc:`/cookbook/security/firewall_restriction`.
188188

189189
.. image:: /images/book/security_anonymous_user_access.png
190190
:align: center

cookbook/security/firewall_restriction.rst

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -131,63 +131,3 @@ the ``^`` and ``$`` regex characters) to the hostname ``admin.example.com``.
131131
If the hostname does not match this pattern, the firewall will not be activated
132132
and subsequent firewalls will have the opportunity to be matched for this
133133
request.
134-
135-
Restricting by HTTP Methods
136-
---------------------------
137-
138-
.. versionadded:: 2.5
139-
Support for restricting security firewalls to specific HTTP methods was introduced in
140-
Symfony 2.5.
141-
142-
The configuration option ``methods`` restricts the initialization of the firewall to
143-
the provided HTTP methods.
144-
145-
.. configuration-block::
146-
147-
.. code-block:: yaml
148-
149-
# app/config/security.yml
150-
151-
# ...
152-
security:
153-
firewalls:
154-
secured_area:
155-
methods: [GET, POST]
156-
# ...
157-
158-
.. code-block:: xml
159-
160-
<!-- app/config/security.xml -->
161-
<?xml version="1.0" encoding="UTF-8"?>
162-
<srv:container xmlns="http://symfony.com/schema/dic/security"
163-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
164-
xmlns:srv="http://symfony.com/schema/dic/services"
165-
xsi:schemaLocation="http://symfony.com/schema/dic/services
166-
http://symfony.com/schema/dic/services/services-1.0.xsd">
167-
168-
<config>
169-
<!-- ... -->
170-
<firewall name="secured_area" methods="GET,POST">
171-
<!-- ... -->
172-
</firewall>
173-
</config>
174-
</srv:container>
175-
176-
.. code-block:: php
177-
178-
// app/config/security.php
179-
180-
// ...
181-
$container->loadFromExtension('security', array(
182-
'firewalls' => array(
183-
'secured_area' => array(
184-
'methods' => array('GET', 'POST'),
185-
// ...
186-
),
187-
),
188-
));
189-
190-
In this example, the firewall will only be activated if the HTTP method of the
191-
request is either ``GET`` or ``POST``. If the method is not in the array of the
192-
allowed methods, the firewall will not be activated and subsequent firewalls will again
193-
have the opportunity to be matched for this request.

0 commit comments

Comments
 (0)
0