Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@damienfern
Copy link
Contributor

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

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 :

# config/packages/security.yamlsecurity:# ...role_hierarchy:ROLE_ADMIN:ROLE_USERROLE_SUPER_ADMIN:[ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
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_SWITCH
Loading

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.

OskarStark, welcoMattic, chalasr, alexandre-daubois, valtzu, elkuku, gilles-g, NiklasBr, and vinceAmstoutz reacted with rocket emoji
@carsonbotcarsonbot added this to the7.4 milestoneJul 4, 2025
@carsonbotcarsonbot changed the title[Security] [SecurityBundle] Dump role hierarchy as mermaid chart[Security][SecurityBundle] Dump role hierarchy as mermaid chartJul 4, 2025
@94noni
Copy link
Contributor

Nice one 👍🏻
Question: would it be possible to include this in the profiler like the workflow dump ?
We can even imagine each role box colored depending on the current user roles from this config map

GromNaN, damienfern, valtzu, and NiklasBr reacted with thumbs up emoji

@damienfern
Copy link
ContributorAuthor

Nice one 👍🏻
Question: would it be possible to include this in the profiler like the workflow dump ?

Yes, I had also this in mind for a second PR, once this one gets merged.

We can even imagine each role box colored depending on the current user roles from this config map

Great idea ! I'll keep it in mind :)

94noni reacted with thumbs up emoji

@damienferndamienfernforce-pushed thefeat/dump-role-chart-mermaid branch 3 times, most recently from702f4a3 to96d1fdaCompareJuly 18, 2025 16:01
Copy link
Contributor

@94noni94noni left a comment

Choose a reason for hiding this comment

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

nice 👍🏻

@fabpotfabpotforce-pushed thefeat/dump-role-chart-mermaid branch from1375f50 to733fd0dCompareSeptember 6, 2025 11:58
@fabpot
Copy link
Member

Thank you@damienfern.

@fabpotfabpot merged commiteedf441 intosymfony:7.4Sep 6, 2025
7 of 12 checks passed
This was referencedOct 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

@alexandre-dauboisalexandre-dauboisAwaiting requested review from alexandre-daubois

@welcoMatticwelcoMatticAwaiting requested review from welcoMattic

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

@stofstofAwaiting requested review from stof

+1 more reviewer

@94noni94noni94noni approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

9 participants

@damienfern@94noni@fabpot@stof@welcoMattic@OskarStark@alexandre-daubois@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp