Commit 19c4524a by Damien Moulard

temporary change: allow superadmin to inpersonate users in prod mode

parent 20ada015
...@@ -53,7 +53,9 @@ class UserAdmin extends SonataUserAdmin ...@@ -53,7 +53,9 @@ class UserAdmin extends SonataUserAdmin
parent::configureListFields($listMapper); parent::configureListFields($listMapper);
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
if ('dev' == $_ENV['APP_ENV'] && $this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { // TODO: SECURITY BREACH, RESET ASAP!!!
// if ('dev' == $_ENV['APP_ENV'] && $this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
$listMapper $listMapper
->add('impersonating', 'string', ['template' => '@SonataUser/Admin/Field/impersonating.html.twig']) ->add('impersonating', 'string', ['template' => '@SonataUser/Admin/Field/impersonating.html.twig'])
; ;
......
...@@ -83,7 +83,9 @@ class UserAdmin extends BaseUserAdmin ...@@ -83,7 +83,9 @@ class UserAdmin extends BaseUserAdmin
]) ])
; ;
if ('dev' == $_ENV['APP_ENV'] && $this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { // TODO: SECURITY BREACH, RESET ASAP!!!
// if ('dev' == $_ENV['APP_ENV'] && $this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
$listMapper $listMapper
->add('impersonating', 'string', ['template' => '@SonataUser/Admin/Field/impersonating.html.twig']) ->add('impersonating', 'string', ['template' => '@SonataUser/Admin/Field/impersonating.html.twig'])
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment