Skip to content

Commit ba72a2f

Browse files
committed
feature #44284 [SecurityBundle] Display the inherited roles of the logged-in user in the WDT (jmsche)
This PR was merged into the 6.1 branch. Discussion ---------- [SecurityBundle] Display the inherited roles of the logged-in user in the WDT | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Hi, As suggested on Slack by Javier it would be interesting to see inherited roles in the WDT to debug quickly. [Edit] Aaaand the screenshot :) ![screenshot-wdt](https://user-images.githubusercontent.com/3929498/143581726-c400191d-734a-486d-aed1-03749dc12347.png) Commits ------- eac0c8c Display the inherited roles of the logged-in user in the Web Debug Toolbar
2 parents 50749dd + eac0c8c commit ba72a2f

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ CHANGELOG
33

44
6.1
55
---
6-
* The `security.access_control` now accepts a `RequestMatcherInterface` under the `request_matcher` option as scope configuration
6+
7+
* The `security.access_control` now accepts a `RequestMatcherInterface` under the `request_matcher` option as scope configuration
8+
* Display the inherited roles of the logged-in user in the Web Debug Toolbar
79

810
6.0
911
---

src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@
4646
</span>
4747
</div>
4848

49+
{% if collector.supportsRoleHierarchy %}
50+
<div class="sf-toolbar-info-piece">
51+
<b>Inherited Roles</b>
52+
<span>
53+
{% if collector.inheritedRoles is empty %}
54+
none
55+
{% else %}
56+
{% set remainingRoles = collector.inheritedRoles|slice(1) %}
57+
{{ collector.inheritedRoles|first }}
58+
{% if remainingRoles is not empty %}
59+
+
60+
<abbr title="{{ remainingRoles|join(', ') }}">
61+
{{ remainingRoles|length }} more
62+
</abbr>
63+
{% endif %}
64+
{% endif %}
65+
</span>
66+
</div>
67+
{% endif %}
68+
4969
<div class="sf-toolbar-info-piece">
5070
<b>Token class</b>
5171
<span>{{ collector.tokenClass|abbr_class }}</span>

0 commit comments

Comments
 (0)