Skip to content

Commit 1efbe33

Browse files
committed
bug #6968 fix: Symfony 7.3 deprecations (maks-oleksyuk)
This PR was squashed before being merged into the 4.x branch. Discussion ---------- fix: Symfony 7.3 deprecations Fixes #6962 Commits ------- a50a0ee fix: Symfony 7.3 deprecations
2 parents 8c5e5f3 + a50a0ee commit 1efbe33

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Security/AuthorizationChecker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace EasyCorp\Bundle\EasyAdminBundle\Security;
44

5+
use Symfony\Component\Security\Core\Authorization\AccessDecision;
56
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
67
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
78

@@ -20,7 +21,7 @@ public function __construct(AuthorizationCheckerInterface $authorizationChecker)
2021
$this->authorizationChecker = $authorizationChecker;
2122
}
2223

23-
public function isGranted($permission, $subject = null): bool
24+
public function isGranted($permission, $subject = null, ?AccessDecision $accessDecision = null): bool
2425
{
2526
// this check is needed for performance reasons because most of the times permissions
2627
// won't be set, so this function must return as early as possible in those cases

src/Security/SecurityVoter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto;
1111
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1212
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
13+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
1314
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
1415

1516
/**
@@ -33,7 +34,7 @@ public function supportsAttribute(string $permissionName): bool
3334
return Permission::exists($permissionName);
3435
}
3536

36-
protected function voteOnAttribute($permissionName, $subject, TokenInterface $token): bool
37+
protected function voteOnAttribute($permissionName, $subject, TokenInterface $token, ?Vote $vote = null): bool
3738
{
3839
if (Permission::EA_VIEW_MENU_ITEM === $permissionName) {
3940
return $this->voteOnViewMenuItemPermission($subject);

0 commit comments

Comments
 (0)