Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/dashboards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
3 changes: 2 additions & 1 deletion src/Security/AuthorizationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Security/SecurityVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand All @@ -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);
Expand Down