removed ForbiddenHttpException
Both HttpKernel and Security define a 403 exception: * Symfony\Component\HttpKernel\Exception\ForbiddenHttpException * Symfony\Component\Security\Exception\AccessDeniedException The one in HttpKernel has been removed in favor of the Security one.
This commit is contained in:
parent
d036448542
commit
131776001f
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Exception;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ForbiddenHttpException.
|
||||
*
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*/
|
||||
class ForbiddenHttpException extends HttpException
|
||||
{
|
||||
public function __construct($message = 'Forbidden', \Exception $previous = null)
|
||||
{
|
||||
parent::__construct($message, 403, $previous);
|
||||
}
|
||||
}
|
@ -86,7 +86,7 @@ class AccessListener implements ListenerInterface
|
||||
}
|
||||
|
||||
if (!$this->accessDecisionManager->decide($token, $attributes, $request)) {
|
||||
throw new AccessDeniedException('Access is denied.');
|
||||
throw new AccessDeniedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
namespace Symfony\Component\Security\Authorization;
|
||||
|
||||
use Symfony\Component\Security\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Exception\InsufficientAuthenticationException;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
|
@ -18,7 +18,7 @@ namespace Symfony\Component\Security\Exception;
|
||||
*/
|
||||
class AccessDeniedException extends \RuntimeException
|
||||
{
|
||||
public function __construct($message = '', $code = 403, \Exception $previous = null)
|
||||
public function __construct($message = 'Access Denied', \Exception $previous = null)
|
||||
{
|
||||
parent::__construct($message, 403, $previous);
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
namespace Symfony\Component\Security\User;
|
||||
|
||||
use Symfony\Component\Security\Exception\UsernameNotFoundException;
|
||||
use Symfony\Component\Security\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Authentication\Token\UsernamePasswordToken;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
|
Reference in New Issue
Block a user