Skip to content

Commit b210e51

Browse files
committed
Display the inherited roles of the logged-in user in the Web Debug Toolbar
1 parent 12758d5 commit b210e51

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

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
---

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)