feat: superadmin attribute for extended permissions like impersonating

This commit is contained in:
Björn Fromme
2024-04-17 18:06:56 +02:00
parent 30218d6f80
commit 8b4e9f546b
4 changed files with 61 additions and 1 deletions
+5 -1
View File
@@ -40,6 +40,10 @@ class ImpersonationVoter extends Voter
}
// Admin is the only role allowed to impersonate
return $this->security->isGranted('ROLE_ADMIN');
if (false === $this->security->isGranted('ROLE_ADMIN')) {
return false;
}
return $currentUser->isSuperAdmin();
}
}