Skip to content

Commit 56e475c

Browse files
committed
Fixes after review
1 parent 8d4f444 commit 56e475c

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

book/security.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Basic Example: HTTP Authentication
3434
The Security component can be configured via your application configuration.
3535
In fact, most standard security setups are just a matter of using the right
3636
configuration. The following configuration tells Symfony to secure any URL
37-
matching ``/admin*`` and to ask the user for credentials using basic HTTP
37+
matching ``/admin/*`` and to ask the user for credentials using basic HTTP
3838
authentication (i.e. the old-school username/password box):
3939

4040
.. configuration-block::
@@ -51,7 +51,9 @@ authentication (i.e. the old-school username/password box):
5151
realm: "Secured Demo Area"
5252
5353
access_control:
54-
- { path: ^/admin, roles: ROLE_ADMIN }
54+
- { path: ^/admin/, roles: ROLE_ADMIN }
55+
# Include the following line to also secure the /admin path itself
56+
# - { path: ^/admin$, roles: ROLE_ADMIN }
5557
5658
providers:
5759
in_memory:
@@ -79,7 +81,9 @@ authentication (i.e. the old-school username/password box):
7981
</firewall>
8082
8183
<access-control>
82-
<rule path="^/admin" role="ROLE_ADMIN" />
84+
<rule path="^/admin/" role="ROLE_ADMIN" />
85+
<!-- Include the following line to also secure the /admin path itself -->
86+
<!-- <rule path="^/admin$" role="ROLE_ADMIN" /> -->
8387
</access-control>
8488
8589
<provider name="in_memory">
@@ -108,7 +112,9 @@ authentication (i.e. the old-school username/password box):
108112
),
109113
),
110114
'access_control' => array(
111-
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
115+
array('path' => '^/admin/', 'role' => 'ROLE_ADMIN'),
116+
// Include the following line to also secure the /admin path itself
117+
// array('path' => '^/admin$', 'role' => 'ROLE_ADMIN'),
112118
),
113119
'providers' => array(
114120
'in_memory' => array(
@@ -143,9 +149,9 @@ that looks like the following:
143149

144150
* There are two users in the system (``ryan`` and ``admin``);
145151
* Users authenticate themselves via the basic HTTP authentication prompt;
146-
* Any URL matching ``/admin*`` is secured, and only the ``admin`` user
152+
* Any URL matching ``/admin/*`` is secured, and only the ``admin`` user
147153
can access it;
148-
* All URLs *not* matching ``/admin*`` are accessible by all users (and the
154+
* All URLs *not* matching ``/admin/*`` are accessible by all users (and the
149155
user is never prompted to log in).
150156

151157
Read this short summary about how security works and how each part of the
@@ -193,7 +199,7 @@ Access Controls (Authorization)
193199
If a user requests ``/admin/foo``, however, the process behaves differently.
194200
This is because of the ``access_control`` configuration section that says
195201
that any URL matching the regular expression pattern ``^/admin`` (i.e. ``/admin``
196-
or anything matching ``/admin*``) requires the ``ROLE_ADMIN`` role. Roles
202+
or anything matching ``/admin/*``) requires the ``ROLE_ADMIN`` role. Roles
197203
are the basis for most authorization: a user can access ``/admin/foo`` only
198204
if it has the ``ROLE_ADMIN`` role.
199205

components/dependency_injection/advanced.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ service by asking for the ``bar`` service like this::
142142

143143
$container->get('bar'); // Would return the foo service
144144

145-
.. note::
145+
.. tip::
146146

147147
In YAML, you can also use a shortcut to alias a service:
148148

@@ -181,5 +181,5 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
181181
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
182182
$container->setDefinition('foo', $definition);
183183
184-
Notice that Symfony will internally call the PHP statement ``require_once``
184+
Notice that Symfony will internally call the PHP statement ``require_once``,
185185
which means that your file will be included only once per request.

reference/forms/types/entity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ group_by
125125

126126
This is a property path (e.g. ``author.name``) used to organize the
127127
available choices in groups. It only works when rendered as a select tag
128-
and does so by adding ``optgroup`` tags around options. Choices that do not
128+
and does so by adding ``optgroup`` elements around options. Choices that do not
129129
return a value for this property path are rendered directly under the
130130
select tag, without a surrounding optgroup.
131131

0 commit comments

Comments
 (0)