-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[SecurityBundle] add role hierarchy graph to profiler security panel #61786
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
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.
@damienfern waw very nice one! I like it
may I ask you how difficult/challenging (if doable) can it be to do the "second part" of my comment?
related to visualizing the current request user roles inside this newly added graph?
(for example take as comparison the voter part with granted/denied etc with green/red or highlighted color)
</tr> | ||
|
||
{% if collector.supportsRoleHierarchy %} | ||
<script> |
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.
perhaps check if the data is not null/not empty before loading all this?
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.
That's a good idea indeed.
Maybe rename "Roles Diagram" to "Available Roles"? I mean it is clear that this is a diagram |
I still have it in mind, but no idea how to do it. I pushed this PR first so once it is merged, I can start working on it. |
src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php
Outdated
Show resolved
Hide resolved
647552e
to
d4034b7
Compare
</tr> | ||
|
||
{% if collector.supportsRoleHierarchy %} | ||
<script> |
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.
That's a good idea indeed.
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.
Otherwise LGTM after @94noni suggestion
if (null !== $this->roleHierarchy) { | ||
$this->data['roles_diagram'] = $this->mermaidDumper->dump($this->roleHierarchy); | ||
} |
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.
if (null !== $this->roleHierarchy) { | |
$this->data['roles_diagram'] = $this->mermaidDumper->dump($this->roleHierarchy); | |
} | |
if ($this->roleHierarchy) { | |
$this->data['roles_diagram'] = $this->mermaidDumper->dump($this->roleHierarchy); | |
} |
As promised here, here it is. This PR adds the role hierarchy chart to the security panel of the profiler.
Here is how it looks (heavily inspired by the workflow graph) :