fix: prevent impersonating superadmin users

This commit is contained in:
Björn Fromme
2024-04-19 16:14:11 +02:00
parent d32a93a07b
commit 4585f189b6
@@ -39,6 +39,11 @@ class ImpersonationVoter extends Voter
return false; 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 // Admin is the only role allowed to impersonate
if (false === $this->security->isGranted('ROLE_ADMIN')) { if (false === $this->security->isGranted('ROLE_ADMIN')) {
return false; return false;