Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 901c838

Browse files
committed
minor #16455 [Security] Update access_control.rst (KamilPesek)
This PR was merged into the 6.0 branch. Discussion ---------- [Security] Update access_control.rst I believe there should be PUBLIC_ACCESS instead of IS_AUTHENTICATED_ANONYMOUSLY for Symfony 6 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 279da7d Update access_control.rst
2 parents b0d2d65 + 279da7d commit 901c838

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

security/access_control.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pattern so that it is only accessible by requests from the local server itself:
236236
access_control:
237237
#
238238
# the 'ips' option supports IP addresses and subnet masks
239-
- { path: '^/internal', roles: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1, 192.168.0.1/24] }
239+
- { path: '^/internal', roles: PUBLIC_ACCESS, ips: [127.0.0.1, ::1, 192.168.0.1/24] }
240240
- { path: '^/internal', roles: ROLE_NO_ACCESS }
241241
242242
.. code-block:: xml
@@ -255,7 +255,7 @@ pattern so that it is only accessible by requests from the local server itself:
255255
<!-- ... -->
256256
257257
<!-- the 'ips' option supports IP addresses and subnet masks -->
258-
<rule path="^/internal" role="IS_AUTHENTICATED_ANONYMOUSLY">
258+
<rule path="^/internal" role="PUBLIC_ACCESS">
259259
<ip>127.0.0.1</ip>
260260
<ip>::1</ip>
261261
</rule>
@@ -274,7 +274,7 @@ pattern so that it is only accessible by requests from the local server itself:
274274
275275
$security->accessControl()
276276
->path('^/internal')
277-
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
277+
->roles(['PUBLIC_ACCESS'])
278278
// the 'ips' option supports IP addresses and subnet masks
279279
->ips(['127.0.0.1', '::1'])
280280
;
@@ -302,7 +302,7 @@ address):
302302

303303
* Now, the first access control rule is enabled as both the ``path`` and the
304304
``ip`` match: access is allowed as the user always has the
305-
``IS_AUTHENTICATED_ANONYMOUSLY`` role.
305+
``PUBLIC_ACCESS`` role.
306306

307307
* The second access rule is not examined as the first rule matched.
308308

@@ -407,7 +407,7 @@ access those URLs via a specific port. This could be useful for example for
407407
security:
408408
# ...
409409
access_control:
410-
- { path: ^/cart/checkout, roles: IS_AUTHENTICATED_ANONYMOUSLY, port: 8080 }
410+
- { path: ^/cart/checkout, roles: PUBLIC_ACCESS, port: 8080 }
411411
412412
.. code-block:: xml
413413
@@ -424,7 +424,7 @@ access those URLs via a specific port. This could be useful for example for
424424
<config>
425425
<!-- ... -->
426426
<rule path="^/cart/checkout"
427-
role="IS_AUTHENTICATED_ANONYMOUSLY"
427+
role="PUBLIC_ACCESS"
428428
port="8080"
429429
/>
430430
</config>
@@ -440,7 +440,7 @@ access those URLs via a specific port. This could be useful for example for
440440
441441
$security->accessControl()
442442
->path('^/cart/checkout')
443-
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
443+
->roles(['PUBLIC_ACCESS'])
444444
->port(8080)
445445
;
446446
};
@@ -461,7 +461,7 @@ the user will be redirected to ``https``:
461461
security:
462462
# ...
463463
access_control:
464-
- { path: ^/cart/checkout, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
464+
- { path: ^/cart/checkout, roles: PUBLIC_ACCESS, requires_channel: https }
465465
466466
.. code-block:: xml
467467
@@ -478,7 +478,7 @@ the user will be redirected to ``https``:
478478
<config>
479479
<!-- ... -->
480480
<rule path="^/cart/checkout"
481-
role="IS_AUTHENTICATED_ANONYMOUSLY"
481+
role="PUBLIC_ACCESS"
482482
requires-channel="https"
483483
/>
484484
</config>
@@ -494,7 +494,7 @@ the user will be redirected to ``https``:
494494
495495
$security->accessControl()
496496
->path('^/cart/checkout')
497-
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
497+
->roles(['PUBLIC_ACCESS'])
498498
->requiresChannel('https')
499499
;
500500
};

0 commit comments

Comments
 (0)