-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security][SecurityBundle] Dump role hierarchy as mermaid chart #61034
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
base: 7.4
Are you sure you want to change the base?
Conversation
src/Symfony/Bundle/SecurityBundle/Command/SecurityRoleHierarchyDumpCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/Command/SecurityRoleHierarchyDumpCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/Tests/Command/SecurityRoleHierarchyDumpCommandTest.php
Outdated
Show resolved
Hide resolved
]; | ||
|
||
public function __construct( | ||
private readonly string $direction = self::DIRECTION_TOP_TO_BOTTOM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving $direction
argument to dump
method would allow to dump multiple times the same role hierarchy in different directions without the need to instanciate multiple dumpers. WDYT?
7.4 | ||
--- | ||
|
||
* Added `MermaidDumper` to dump Role Hierarchy graphs in the Mermaid.js flowchart format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Added `MermaidDumper` to dump Role Hierarchy graphs in the Mermaid.js flowchart format | |
* Add `MermaidDumper` to dump Role Hierarchy graphs in the Mermaid.js flowchart format |
Nice one 👍🏻 |
From a developer POV, Roles and the SecurityBundle are so convenient, specially role hierarchy in the config. But as a web app grows, the number of roles also grows and with role inheritance, it can be painful to clearly see which role implies another which implies another which implies another (and its possible consequences).
I'm proposing a new command in the security bundle to generate a Mermaid flowchart, easing the understanding of the roles and its hierarchy. An example of the graph generated from the role hierarchy in the doc :
For now, only the mermaid format is suggested (the only format I know) but as the worfklow dump command, we could implement graphviz and plantuml format later.