Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
19c4524a
Commit
19c4524a
authored
Jan 30, 2023
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temporary change: allow superadmin to inpersonate users in prod mode
parent
20ada015
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
UserAdmin.php
src/Admin/UserAdmin.php
+3
-1
UserAdmin.php
src/Application/Sonata/UserBundle/Admin/UserAdmin.php
+3
-1
No files found.
src/Admin/UserAdmin.php
View file @
19c4524a
...
...
@@ -53,7 +53,9 @@ class UserAdmin extends SonataUserAdmin
parent
::
configureListFields
(
$listMapper
);
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
->
add
(
'impersonating'
,
'string'
,
[
'template'
=>
'@SonataUser/Admin/Field/impersonating.html.twig'
])
;
...
...
src/Application/Sonata/UserBundle/Admin/UserAdmin.php
View file @
19c4524a
...
...
@@ -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
->
add
(
'impersonating'
,
'string'
,
[
'template'
=>
'@SonataUser/Admin/Field/impersonating.html.twig'
])
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment