-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[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
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
|
Nice one 👍🏻 |
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
src/Symfony/Bundle/SecurityBundle/Tests/Command/SecurityRoleHierarchyDumpCommandTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/Tests/Command/SecurityRoleHierarchyDumpCommandTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/Tests/Command/SecurityRoleHierarchyDumpCommandTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Tests/Dumper/MermaidDumperTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Tests/Dumper/MermaidDumperTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Tests/Dumper/MermaidDumperTest.php
Outdated
Show resolved
Hide resolved
Yes, I had also this in mind for a second PR, once this one gets merged.
Great idea ! I'll keep it in mind :) |
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/Command/SecurityRoleHierarchyDumpCommand.php
Outdated
Show resolved
Hide resolved
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/Command/SecurityRoleHierarchyDumpCommand.php
Outdated
Show resolved
Hide resolved
702f4a3 to
96d1fda
Compare
94noni
left a comment
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.
nice 👍🏻
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/DependencyInjection/Compiler/MermaidDumperCommandPass.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/MermaidDumperCommandPass.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/MermaidDumperCommandPass.php
Outdated
Show resolved
Hide resolved
66af046 to
9ec7a1a
Compare
d3d9f4a to
37982f6
Compare
src/Symfony/Bundle/SecurityBundle/Command/SecurityRoleHierarchyDumpCommand.php
Outdated
Show resolved
Hide resolved
f35574f to
1375f50
Compare
1375f50 to
733fd0d
Compare
|
Thank you @damienfern. |
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 :
graph TB ROLE_ADMIN ROLE_USER ROLE_SUPER_ADMIN ROLE_ALLOWED_TO_SWITCH ROLE_ADMIN --> ROLE_USER ROLE_SUPER_ADMIN --> ROLE_ADMIN ROLE_SUPER_ADMIN --> ROLE_ALLOWED_TO_SWITCHFor 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.