You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ForbiddenHttpException.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\web;
  8. /**
  9. * ForbiddenHttpException represents a "Forbidden" HTTP exception with status code 403.
  10. *
  11. * Use this exception when a user has been authenticated but is not allowed to
  12. * perform the requested action. If the user is not authenticated, consider
  13. * using a 401 [[UnauthorizedHttpException]]. If you do not want to
  14. * expose authorization information to the user, it is valid to respond with a
  15. * 404 [[NotFoundHttpException]].
  16. *
  17. * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4
  18. * @author Dan Schmidt <danschmidt5189@gmail.com>
  19. * @since 2.0
  20. */
  21. class ForbiddenHttpException extends HttpException
  22. {
  23. /**
  24. * Constructor.
  25. * @param string $message error message
  26. * @param integer $code error code
  27. * @param \Exception $previous The previous exception used for the exception chaining.
  28. */
  29. public function __construct($message = null, $code = 0, \Exception $previous = null)
  30. {
  31. parent::__construct(403, $message, $code, $previous);
  32. }
  33. }