Skip to content

Commit

Permalink
Use simple type in PolicyService::getRole()
Browse files Browse the repository at this point in the history
to keep unit tests working
  • Loading branch information
bwaidelich committed Nov 13, 2024
1 parent 32bbd2d commit 073a2b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Security/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,18 @@ public function getRoles()
return $this->roles;
}

$this->roles = [RoleId::everybody()->value => $this->policyService->getRole(RoleId::everybody())];
$this->roles = [RoleId::everybody()->value => $this->policyService->getRole(RoleId::everybody()->value)];

$authenticatedTokens = array_filter($this->getAuthenticationTokens(), static function (TokenInterface $token) {
return $token->isAuthenticated();
});

if (empty($authenticatedTokens)) {
$this->roles[RoleId::anonymous()->value] = $this->policyService->getRole(RoleId::anonymous());
$this->roles[RoleId::anonymous()->value] = $this->policyService->getRole(RoleId::anonymous()->value);
return $this->roles;
}

$this->roles[RoleId::authenticatedUser()->value] = $this->policyService->getRole(RoleId::authenticatedUser());
$this->roles[RoleId::authenticatedUser()->value] = $this->policyService->getRole(RoleId::authenticatedUser()->value);

foreach ($authenticatedTokens as $token) {
$account = $token->getAccount();
Expand Down

0 comments on commit 073a2b0

Please sign in to comment.