Fixing automatic replacing of AccessDeniedExceptions with InsufficientAuthenticationException in Symfony\Component\Security\Http\Firewall\ExceptionListener::handleAccessDeniedException().

This commit is contained in:
Alexey Skobkin 2019-04-03 20:16:34 +03:00
parent aa751bbbc1
commit 44c4158602
2 changed files with 8 additions and 3 deletions

View file

@ -9,4 +9,11 @@ security:
security: false
default:
anonymous: ~
# Needs to be changed if authentication is added
# Also it needs to be carefully checked that after enabling security here
# \Symfony\Component\Security\Http\Firewall\ExceptionListener::handleAccessDeniedException() doesn't start to replace 403 by 401 exceptions
# for all users
# For example \Skobkin\Bundle\PointToolsBundle\Controller\PostController::showAction() can return AccessDeniedException and this logic must be saved
# After enabling authentication
security: false
#anonymous: true

View file

@ -12,8 +12,6 @@ class PostController extends AbstractController
{
/**
* @ParamConverter("post", class="SkobkinPointToolsBundle:Blogs\Post")
*
* @return Response
*/
public function showAction(Post $post, PostRepository $postRepository): Response
{