I want to show something like this:
Case 1: "registered as a user"
@UserName [logout]
There are no problems here, I just do:
@ {{app.user.username}} [<a href = "{{path (" logout ")}}"> logout </a>]
Case 2: "registered as ADMIN"
@AdminName [logout]
The same thing works here:
@ {{app.user.username}} [<a href = "{{path (" logout ")}}"> logout </a>]
Case 3: "registered as an ADMIN impersonating a USER"
AdminName @UserName [return]
Now the problem is:
{{ ?? .. what's here .. ?? }} @ {{app.user.username}} [<a href = "{{(app.request.getRequestUri ~ '? _switch_user = _exit')}}"> return </a>]
, ... , sipmle, :/
{
{% for role in app.security.token.roles %}
{% if role.source is defined %}
{{ role.source.user.username }}
{% endif %}
{% endfor %}
@ {{ app.user.username }} [ <a href="{{ (app.request.getRequestUri ~ '?_switch_user=_exit') }}">return</a> ]
? TWIG → ( ) → , .