feat: rename ROLE_ADMIN to ROLE_TEAM_ADMIN since being too broad
This commit is contained in:
@@ -35,7 +35,7 @@ class MyEpAuthenticator extends AbstractAuthenticator
|
||||
* is dropped rather than stored, so that no role this application assigns a meaning
|
||||
* to can be set from the outside.
|
||||
*/
|
||||
private const ELIGIBLE_ROLES = ['ROLE_ADMIN', 'ROLE_TEAMER', 'ROLE_MANAGER', 'ROLE_HOUSE_MANAGER'];
|
||||
private const ELIGIBLE_ROLES = ['ROLE_TEAM_ADMIN', 'ROLE_TEAMER', 'ROLE_MANAGER', 'ROLE_HOUSE_MANAGER'];
|
||||
|
||||
public function __construct(
|
||||
private readonly MyEpClient $client,
|
||||
|
||||
@@ -60,7 +60,7 @@ class DispositionVoter extends Voter
|
||||
static::CONTRACT, static::INVOICE => false === $disposition->isSkipFormalities()
|
||||
&& ($this->security->isGranted('ROLE_ADMINISTRATIVE')
|
||||
|| $this->assertTeamerAccess($token, $disposition)),
|
||||
static::DELETE => $this->security->isGranted('ROLE_ADMIN'),
|
||||
static::DELETE => $this->security->isGranted('ROLE_TEAM_ADMIN'),
|
||||
static::FEEDBACK => false === $disposition->isSkipFormalities()
|
||||
&& ($this->security->isGranted('ROLE_ADMINISTRATIVE')
|
||||
|| $this->assertHouseManagerAccess($token, $disposition)),
|
||||
@@ -162,7 +162,7 @@ class DispositionVoter extends Voter
|
||||
private function assertAdminDocumentUploadAllowed(Disposition $disposition): bool
|
||||
{
|
||||
if (false === $this->security->isGranted('ROLE_ADMINISTRATIVE')
|
||||
&& false === $this->security->isGranted('ROLE_ADMIN')) {
|
||||
&& false === $this->security->isGranted('ROLE_TEAM_ADMIN')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class FeedbackVoter extends Voter
|
||||
/** @var Feedback $feedback */
|
||||
$feedback = $subject;
|
||||
|
||||
if (in_array('ROLE_ADMIN', $token->getRoleNames())) {
|
||||
if (in_array('ROLE_TEAM_ADMIN', $token->getRoleNames())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class ImpersonationVoter extends Voter
|
||||
}
|
||||
|
||||
// Admin is the only role allowed to impersonate
|
||||
if (false === $this->security->isGranted('ROLE_ADMIN')) {
|
||||
if (false === $this->security->isGranted('ROLE_TEAM_ADMIN')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user