Browse Source

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.
Fabien Potencier 14 years ago
parent
commit
131776001f

+ 0 - 25
src/Symfony/Component/HttpKernel/Exception/ForbiddenHttpException.php

@@ -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);
-    }
-}

+ 1 - 1
src/Symfony/Component/HttpKernel/Security/Firewall/AccessListener.php

@@ -86,7 +86,7 @@ class AccessListener implements ListenerInterface
         }
 
         if (!$this->accessDecisionManager->decide($token, $attributes, $request)) {
-            throw new AccessDeniedException('Access is denied.');
+            throw new AccessDeniedException();
         }
     }
 }

+ 0 - 2
src/Symfony/Component/Security/Authorization/AccessDecisionManagerInterface.php

@@ -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.

+ 1 - 1
src/Symfony/Component/Security/Exception/AccessDeniedException.php

@@ -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);
     }

+ 0 - 2
src/Symfony/Component/Security/User/InMemoryUserProvider.php

@@ -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.