Skip to content

Commit

Permalink
Fix relocation allow from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Dec 10, 2024
1 parent a683e60 commit 2a56b79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Security/Voter/RelocationVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ protected function supports(string $attribute, mixed $subject): bool
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
{
$user = $token->getUser();

if ($this->allowBookRelocation && PHP_SAPI === 'cli') {
return true;
}
// if the user is anonymous, do not grant access
if (!$user instanceof UserInterface) {
return false;
Expand Down

0 comments on commit 2a56b79

Please sign in to comment.