Skip to content

Commit 6aa4545

Browse files
committed
Fix for next release of voters in symfony
1 parent ba0e141 commit 6aa4545

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/Security/Voter/ComponentVoter.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\HttpFoundation\Response;
2727
use Symfony\Component\HttpKernel\HttpKernelInterface;
2828
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
29+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
2930
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
3031
use Symfony\Component\Serializer\Exception\NotEncodableValueException;
3132

@@ -57,7 +58,7 @@ protected function supports($attribute, $subject): bool
5758
/**
5859
* @param AbstractComponent $subject
5960
*/
60-
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
61+
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
6162
{
6263
$request = $this->requestStack->getCurrentRequest();
6364
if (!$request) {

‎src/Security/Voter/RoutableVoter.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Silverback\ApiComponentsBundle\Security\EventListener\DenyAccessListener;
2121
use Symfony\Bundle\SecurityBundle\Security;
2222
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
23+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
2324

2425
/**
2526
* If a routable object does not have a route, implement the security configuration. Usually admin only access.
@@ -46,7 +47,7 @@ public function __construct(?string $securityStr, ResourceAccessCheckerInterface
4647
/**
4748
* @param RoutableInterface $routable
4849
*/
49-
protected function voteOnAttribute(string $attribute, $routable, TokenInterface $token): bool
50+
protected function voteOnAttribute(string $attribute, mixed $routable, TokenInterface $token, ?Vote $vote = null): bool
5051
{
5152
if (!$this->securityStr) {
5253
return true;

‎src/Security/Voter/SiteConfigParameterVoter.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\ExpressionLanguage\Expression;
1919
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2020
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
21+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
2122
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
2223
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
2324

@@ -40,7 +41,7 @@ protected function supports($attribute, $subject): bool
4041
/**
4142
* @param Route $subject
4243
*/
43-
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
44+
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
4445
{
4546
return $this->isGranted();
4647
}

0 commit comments

Comments
 (0)