protected function checkAccess(CustomerInterface $customer)
    {
        if (!($user = $this->getUser())
        || !$customer->getUser()
        || $customer->getUser()->getId() !== $user->getId()) {
            throw new AccessDeniedException();
        }
    }
protected function checkAccess(CustomerInterface $customer)
    {
        if (!($user = $this->getUser())
        || !$customer->getUser()
        || $customer->getUser()->getId() !== $user->getId()) {
            throw new AccessDeniedException();
        }
    }
protected function checkAccess ( CustomerInterface $ customer ) { if ( ! ( $ user = $ this -> getUser ( ) ) || ! $ customer -> getUser ( ) || $ customer -> getUser ( ) -> getId ( ) !== $ user -> getId ( ) ) { throw new AccessDeniedException ( ) ; } }
Checks that the current logged in user has access to given invoice.

@param CustomerInterface $customer The linked customer

@throws AccessDeniedException
Checks that the current logged in user has access to given invoice .