Release 2.13 (#4659)

This commit is contained in:
Kevin Papst
2024-03-10 15:35:59 +01:00
committed by GitHub
parent a78e8ed8c4
commit dee90bb15e
79 changed files with 1019 additions and 932 deletions

View File

@@ -29,21 +29,23 @@ final class TeamVoter extends Voter
'delete',
];
public function __construct(private RolePermissionManager $permissionManager)
public function __construct(private readonly RolePermissionManager $permissionManager)
{
}
public function supportsAttribute(string $attribute): bool
{
return \in_array($attribute, self::ALLOWED_ATTRIBUTES, true);
}
public function supportsType(string $subjectType): bool
{
return str_contains($subjectType, Team::class);
}
protected function supports(string $attribute, mixed $subject): bool
{
if (!($subject instanceof Team)) {
return false;
}
if (!\in_array($attribute, self::ALLOWED_ATTRIBUTES)) {
return false;
}
return true;
return $subject instanceof Team && $this->supportsAttribute($attribute);
}
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool