Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security] Replacing deprecated role: IS_AUTHENTICATED_ANONYMOUSLY #17793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions 20 security/access_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pattern so that it is only accessible by requests from the local server itself:
access_control:
#
# the 'ips' option supports IP addresses and subnet masks
- { path: '^/internal', roles: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1, 192.168.0.1/24] }
- { path: '^/internal', roles: PUBLIC_ACCESS, ips: [127.0.0.1, ::1, 192.168.0.1/24] }
- { path: '^/internal', roles: ROLE_NO_ACCESS }

.. code-block:: xml
Expand All @@ -259,7 +259,7 @@ pattern so that it is only accessible by requests from the local server itself:
<!-- ... -->

<!-- the 'ips' option supports IP addresses and subnet masks -->
<rule path="^/internal" role="IS_AUTHENTICATED_ANONYMOUSLY">
<rule path="^/internal" role="PUBLIC_ACCESS">
<ip>127.0.0.1</ip>
<ip>::1</ip>
</rule>
Expand All @@ -278,7 +278,7 @@ pattern so that it is only accessible by requests from the local server itself:

$security->accessControl()
->path('^/internal')
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
->roles(['PUBLIC_ACCESS'])
// the 'ips' option supports IP addresses and subnet masks
->ips(['127.0.0.1', '::1'])
;
Expand Down Expand Up @@ -306,7 +306,7 @@ address):

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

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

Expand Down Expand Up @@ -411,7 +411,7 @@ access those URLs via a specific port. This could be useful for example for
security:
# ...
access_control:
- { path: ^/cart/checkout, roles: IS_AUTHENTICATED_ANONYMOUSLY, port: 8080 }
- { path: ^/cart/checkout, roles: PUBLIC_ACCESS, port: 8080 }

.. code-block:: xml

Expand All @@ -428,7 +428,7 @@ access those URLs via a specific port. This could be useful for example for
<config>
<!-- ... -->
<rule path="^/cart/checkout"
role="IS_AUTHENTICATED_ANONYMOUSLY"
role="PUBLIC_ACCESS"
port="8080"
/>
</config>
Expand All @@ -444,7 +444,7 @@ access those URLs via a specific port. This could be useful for example for

$security->accessControl()
->path('^/cart/checkout')
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
->roles(['PUBLIC_ACCESS'])
->port(8080)
;
};
Expand All @@ -465,7 +465,7 @@ the user will be redirected to ``https``:
security:
# ...
access_control:
- { path: ^/cart/checkout, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
- { path: ^/cart/checkout, roles: PUBLIC_ACCESS, requires_channel: https }

.. code-block:: xml

Expand All @@ -482,7 +482,7 @@ the user will be redirected to ``https``:
<config>
<!-- ... -->
<rule path="^/cart/checkout"
role="IS_AUTHENTICATED_ANONYMOUSLY"
role="PUBLIC_ACCESS"
requires-channel="https"
/>
</config>
Expand All @@ -498,7 +498,7 @@ the user will be redirected to ``https``:

$security->accessControl()
->path('^/cart/checkout')
->roles(['IS_AUTHENTICATED_ANONYMOUSLY'])
->roles(['PUBLIC_ACCESS'])
->requiresChannel('https')
;
};
Morty Proxy This is a proxified and sanitized view of the page, visit original site.