File tree 1 file changed +5
-1
lines changed
src/Resources/views/Admin/Core
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ file that was distributed with this source code.
15
15
{% set _logout_uri = url(' sonata_user_admin_security_logout' ) %}
16
16
{% set _logout_text = ' user_block_logout' | trans({}, ' SonataUserBundle' ) %}
17
17
18
- {% if is_granted(' ROLE_PREVIOUS_ADMIN' ) and sonata_user .isImpersonatingEnabled %}
18
+ {# TODO: Remove the check for the IS_IMPERSONATOR constant when dropping support for Symfony 4.4 #}
19
+ {% if sonata_user .isImpersonatingEnabled and (constant (' Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter::IS_IMPERSONATOR' ) is defined ?
20
+ is_granted(' IS_IMPERSONATOR' ) :
21
+ is_granted(' ROLE_PREVIOUS_ADMIN' ))
22
+ %}
19
23
{% set _bg_class = ' bg-light-green' %}
20
24
{% set _logout_uri = url(sonata_user .impersonatingRoute , sonata_user .impersonatingRouteParameters | merge ({' _switch_user' : ' _exit' })) %}
21
25
{% set _logout_text = ' switch_user_exit' | trans({}, ' SonataUserBundle' ) %}
You can’t perform that action at this time.
0 commit comments