Skip to content

Commit

Permalink
Loosen type check for user, to handle more types of users
Browse files Browse the repository at this point in the history
  • Loading branch information
j92 authored and GSadee committed Feb 21, 2023
1 parent 7f21793 commit c84a9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Security/Voter/InvoiceVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

use Sylius\Component\Core\Model\AdminUserInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\ShopUserInterface;
use Sylius\Component\Core\Repository\OrderRepositoryInterface;
use Sylius\Component\Customer\Model\CustomerAwareInterface;
use Sylius\Component\User\Model\UserInterface;
use Sylius\InvoicingPlugin\Entity\InvoiceInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
Expand Down Expand Up @@ -73,7 +73,7 @@ private function canAccess(UserInterface $user, InvoiceInterface $invoice): bool
return true;
}

if ($user instanceof ShopUserInterface) {
if ($user instanceof CustomerAwareInterface) {
$customer = $user->getCustomer();

Assert::isInstanceOf($customer, CustomerInterface::class);
Expand Down

0 comments on commit c84a9d4

Please # to comment.