Sonata\OrderBundle\Controller\OrderController::checkAccess PHP Method

checkAccess() protected method

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