fix: prevent impersonating superadmin users
This commit is contained in:
@@ -39,6 +39,11 @@ class ImpersonationVoter extends Voter
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the target user is superadmin, do not grant access
|
||||
if (true === $targetUser->isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Admin is the only role allowed to impersonate
|
||||
if (false === $this->security->isGranted('ROLE_ADMIN')) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user