diff --git a/doc/dashboards.rst b/doc/dashboards.rst index 7350e9e67d..935072e262 100644 --- a/doc/dashboards.rst +++ b/doc/dashboards.rst @@ -982,8 +982,8 @@ user locale. You can also use ``TranslatableMessage`` objects to define any text content in your backends (e.g. the label of some field, the help contents of some page, etc.):: - use function Symfony\Component\Translation\t; use Symfony\Component\Translation\TranslatableMessage; + use function Symfony\Component\Translation\t; // creating translatable messages using objects TextField::new('firstName', new TranslatableMessage('Name')) diff --git a/src/Security/AuthorizationChecker.php b/src/Security/AuthorizationChecker.php index acfaeef476..13ea53e8a7 100644 --- a/src/Security/AuthorizationChecker.php +++ b/src/Security/AuthorizationChecker.php @@ -2,6 +2,7 @@ namespace EasyCorp\Bundle\EasyAdminBundle\Security; +use Symfony\Component\Security\Core\Authorization\AccessDecision; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; @@ -20,7 +21,7 @@ public function __construct(AuthorizationCheckerInterface $authorizationChecker) $this->authorizationChecker = $authorizationChecker; } - public function isGranted($permission, $subject = null): bool + public function isGranted($permission, $subject = null, ?AccessDecision $accessDecision = null): bool { // this check is needed for performance reasons because most of the times permissions // won't be set, so this function must return as early as possible in those cases diff --git a/src/Security/SecurityVoter.php b/src/Security/SecurityVoter.php index 0d16c07496..7b25ee7f4c 100644 --- a/src/Security/SecurityVoter.php +++ b/src/Security/SecurityVoter.php @@ -10,6 +10,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\Voter; /* @@ -33,7 +34,7 @@ public function supportsAttribute(string $permissionName): bool return Permission::exists($permissionName); } - protected function voteOnAttribute($permissionName, $subject, TokenInterface $token): bool + protected function voteOnAttribute($permissionName, $subject, TokenInterface $token, ?Vote $vote = null): bool { if (Permission::EA_VIEW_MENU_ITEM === $permissionName) { return $this->voteOnViewMenuItemPermission($subject);