From 1460732649ed68ae299941223e1910d3dc0da998 Mon Sep 17 00:00:00 2001 From: Nico Haase Date: Mon, 30 Aug 2021 17:58:45 +0200 Subject: [PATCH] Display the roles of the logged-in user in the Web Debug Toolbar Fixes #42763 --- src/Symfony/Bundle/SecurityBundle/CHANGELOG.md | 1 + .../Resources/views/Collector/security.html.twig | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index f7d2c70d94996..d492609fa94be 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG * Deprecate passing an array of arrays as 1st argument to `MainConfiguration`, pass a sorted flat array of factories instead. * Deprecate the `always_authenticate_before_granting` option + * Display the roles of the logged-in user in the Web Debug Toolbar 5.3 --- diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 6b50856d335cc..dd00683360b99 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -41,6 +41,20 @@ {{ is_authenticated ? 'Yes' : 'No' }} +
+ Roles + + {% set remainingRoles = collector.roles|slice(1) %} + {{ collector.roles|first }} + {% if remainingRoles|length > 1 %} + + + + {{ remainingRoles|length }} more + + {% endif %} + +
+
Token class {{ collector.tokenClass|abbr_class }}