8000 Display the roles of the logged-in user in the Web Debug Toolbar · symfony/symfony@1460732 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1460732

Browse files
committed
Display the roles of the logged-in user in the Web Debug Toolbar
Fixes #42763
1 parent 2ebb835 commit 1460732

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CHANGELOG
1414
* Deprecate passing an array of arrays as 1st argument to `MainConfiguration`, pass a sorted flat array of
1515
factories instead.
1616
* Deprecate the `always_authenticate_before_granting` option
17+
* Display the roles of the logged-in user in the Web Debug Toolbar
1718

1819
5.3
1920
---

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@
4141
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'yellow' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
4242
</div>
4343

44+
<div class="sf-toolbar-info-piece">
45+
<b>Roles</b>
46+
<span>
47+
{% set remainingRoles = collector.roles|slice(1) %}
48+
{{ collector.roles|first }}
49+
{% if remainingRoles|length > 1 %}
50+
+
51+
<abbr title="{{ remainingRoles|join(', ') }}">
52+
{{ remainingRoles|length }} more
53+
</abbr>
54+
{% endif %}
55+
</span>
56+
</div>
57+
4458
<div class="sf-toolbar-info-piece">
4559
<b>Token class</b>
4660
<span>{{ collector.tokenClass|abbr_class }}</span>

0 commit comments

Comments
 (0)
0