<?php

namespace Church\Controller;

use Church\Entity\User\User;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpKernel\Exception\GoneHttpException;

/**
 * @Route(
 *    service="church.controller_user",
 *    defaults = {
 *       "version" = "1.0",
 *       "_format" = "json"
 *    }
 * )
 */
class UserController extends Controller
{

  /**
   * @Route("/user/{user}.{_format}")
   * @Method("GET")
   *
   * @param User $user
   * @param Request $request
   */
    public function showAction(User $user, Request $request) : Response
    {
        if (!$user->isEnabled()) {
            throw new GoneHttpException("User account is disabled");
        }

        $roles = [];
        if ($this->isLoggedIn() && $this->getUser()->isNeighbor($user)) {
            $roles[] = 'neighbor';
        }

        return $this->serializer->serialize($user, $request->getRequestFormat(), $roles);
    }
}

<?php

namespace Church\Controller;

use Church\Entity\User\User;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

/**
 * @Route(
 *    service="church.controller_user",
 *    defaults = {
 *       "version" = "1.0",
 *       "_format" = "json"
 *    }
 * )
 */
class UserController extends Controller
{

  /**
   * @Route("/user/{user}.{_format}")
   * @Method("GET")
   *
   * @param User $user
   * @param Request $request
   */
    public function showAction(User $user, Request $request) : Response
    {
        if (!$user->isEnabled()) {
            throw new NotFoundHttpException("User account is disabled");
        }

        $roles = [];
        if ($this->isLoggedIn() && $this->getUser()->isNeighbor($user)) {
            $roles[] = 'neighbor';
        }

        return $this->serializer->serialize($user, $request->getRequestFormat(), $roles);
    }
}

Use a Not Found exception
Use a Not Found exception
