Skip to content

Commit 4cfa0df

Browse files
committed
Expanded XML examples
1 parent 7d75fad commit 4cfa0df

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

cookbook/security/impersonating_user.rst

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@ done by activating the ``switch_user`` firewall listener:
2323
.. code-block:: xml
2424
2525
<!-- app/config/security.xml -->
26-
<config>
27-
<firewall>
28-
<!-- ... -->
29-
<switch-user />
30-
</firewall>
31-
</config>
26+
<?xml version="1.0" encoding="UTF-8"?>
27+
<srv:container xmlns="http://symfony.com/schema/dic/security"
28+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
29+
xmlns:srv="http://symfony.com/schema/dic/services"
30+
xsi:schemaLocation="http://symfony.com/schema/dic/services
31+
http://symfony.com/schema/dic/services/services-1.0.xsd">
32+
<config>
33+
<firewall>
34+
<!-- ... -->
35+
<switch-user />
36+
</firewall>
37+
</config>
38+
</srv:container>
3239
3340
.. code-block:: php
3441
@@ -99,12 +106,19 @@ setting:
99106
.. code-block:: xml
100107
101108
<!-- app/config/security.xml -->
102-
<config>
103-
<firewall>
104-
<!-- ... -->
105-
<switch-user role="ROLE_ADMIN" parameter="_want_to_be_this_user" />
106-
</firewall>
107-
</config>
109+
<?xml version="1.0" encoding="UTF-8"?>
110+
<srv:container xmlns="http://symfony.com/schema/dic/security"
111+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
112+
xmlns:srv="http://symfony.com/schema/dic/services"
113+
xsi:schemaLocation="http://symfony.com/schema/dic/services
114+
http://symfony.com/schema/dic/services/services-1.0.xsd">
115+
<config>
116+
<firewall>
117+
<!-- ... -->
118+
<switch-user role="ROLE_ADMIN" parameter="_want_to_be_this_user" />
119+
</firewall>
120+
</config>
121+
</srv:container>
108122
109123
.. code-block:: php
110124

0 commit comments

Comments
 (0)