Skip to content
Open
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
13 changes: 13 additions & 0 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,18 @@
:doc:`security voter </security/voters>` that looks for the user roles
in the database.

.. versionadded:: 7.4

To help you debug your roles hierarchy, you can generate a visual representation
of them as SVG or PNG images. First, install the free and open source
`Mermaid CLI`_, providing the ``mmdc`` command, then executes::

.. code-block:: terminal

$ php bin/console debug:security:role-hierarchy | mmdc -o roles.svg

You can open the file `roles.svg` to see the graph.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wdyt about adding an image as example ? As it's done in dump workflow documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not, lets wait others and decide if its relevant 👍🏻

Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't add an image here because the command is simple and easy to understand. Also, images add a maintenance burden to the docs since they must be kept up to date. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oki lets keep without,
also is the text ok or should I rework it?


.. _security-role-authorization:

Add Code to Deny Access
Expand Down Expand Up @@ -2597,7 +2609,7 @@

.. code-block:: html+twig

{% set voter_decision = access_decision('post_edit', post) %}

Check failure on line 2612 in security.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Twig] Unknown "access_decision" function.
{% if voter_decision.isGranted() %}
{# ... #}
{% else %}
Expand Down Expand Up @@ -3130,3 +3142,4 @@
.. _`Login CSRF attacks`: https://en.wikipedia.org/wiki/Cross-site_request_forgery#Forging_login_requests
.. _`PHP date relative formats`: https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative
.. _`Oauth2-client`: https://github.com/thephpleague/oauth2-client
.. _`Mermaid CLI`: https://github.com/mermaid-js/mermaid-cli
Loading