AccessDeniedHandlerInterface.php 925 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony framework.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Symfony\Component\Security\Http\Authorization;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\Security\Core\Exception\AccessDeniedException;
  13. /**
  14. * This is used by the ExceptionListener to translate an AccessDeniedException
  15. * to a Response object.
  16. *
  17. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  18. */
  19. interface AccessDeniedHandlerInterface
  20. {
  21. /**
  22. * Handles an access denied failure.
  23. *
  24. * @param Request $request
  25. * @param AccessDeniedException $accessDeniedException
  26. *
  27. * @return Response may return null
  28. */
  29. function handle(Request $request, AccessDeniedException $accessDeniedException);
  30. }