Skip to content

[DX] Suggest a hint to any auth-check #4304

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

Closed
wants to merge 1 commit into from
Closed
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
30 changes: 30 additions & 0 deletions cookbook/security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,36 @@ application configuration file with the following code.
That's it! Now, when deciding whether or not a user should have access,
the new voter will deny access to any user in the list of blacklisted IPs.

Note that the voters are only called, if any access is actually checked. So
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma is not needed here.

you need at least something like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a colon at the end of the sentence.


.. configuration-block::

.. code-block:: yaml

# app/config/security.yml
security:
access_control:
- { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }

.. code-block:: xml

<!-- app/config/security.xml -->
<config>
<access-control>
<rule path="^/" role="IS_AUTHENTICATED_ANONYMOUSLY" />
</access-control>
</config>

.. code-block:: php

// app/config/security.xml
$container->loadFromExtension('security', array(
'access_control' => array(
array('path' => '^/', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'),
),
));

.. seealso::

For a more advanced usage see
Expand Down