diff --git a/src/Security/Voter/RelocationVoter.php b/src/Security/Voter/RelocationVoter.php index 696b335c..b6ca8436 100644 --- a/src/Security/Voter/RelocationVoter.php +++ b/src/Security/Voter/RelocationVoter.php @@ -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;