merged branch stof/exception_listener (PR #1633)
merged branch stof/exception_listener (PR #1633)

Commits
-------

11369eb Fixed phpdoc
dbe1854 Added a AccessDeniedHttpException to wrap the AccessDeniedException.

Discussion
----------

Added a AccessDeniedHttpException to wrap the AccessDeniedException.

This is a proposal to fix #1631

It wraps the AccessDeniedException in an AccessDeniedHttpException when the firewall is not able to handle it itself. This allows getting a 403 response using the standard exception listener in this case.

Note that the app should not throw the AccessDeniedHttpException itself but keep using the AccessDeniedException to let the Security component check if the user is already fully authenticated or if it should give a chance to authenticate.

---------------------------------------------------------------------------

by fabpot at 2011/07/11 07:10:12 -0700

For reference, I've tried something more radical some time ago here: https://github.com/symfony/symfony/pull/369.

---------------------------------------------------------------------------

by stof at 2011/07/11 07:22:07 -0700

my implementation is what @schmittjoh suggested in the comments on your PR.

symfony/HttpKernel,symfony/http-kernel