# ivyforms/1.5/backend/src/Common/Exceptions/ForbiddenException.php

The Innovative Form Builder – IvyForms, version 1.5. 37 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/1.5/code/backend/src/Common/Exceptions/ForbiddenException.php
- Raw: https://pluginprobe.com/plugins/ivyforms/1.5/raw/backend/src/Common/Exceptions/ForbiddenException.php
- Modified: 2026-10-05T14:37:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ivyforms/1.5/code/backend/src/Common/Exceptions/ForbiddenException.php#L10-L20`.

```php
<?php

/**
 * @copyright © Melograno Venture Studio. All rights reserved.
 * @licence   See LICENCE.md for license details.
 */

namespace IvyForms\Common\Exceptions;

use Exception;

/**
 * Class ForbiddenException
 *
 * Handled by Controller to return a JSON 403 REST response.
 *
 * @package IvyForms\Common\Exceptions
 */
class ForbiddenException extends Exception
{
    /**
     * ForbiddenException constructor.
     *
     * @param string         $message
     * @param int            $code
     * @param Exception|null $previous
     */
    public function __construct($message = '', $code = 403, ?Exception $previous = null)
    {
        if ($message === '' || $message === 'forbidden') {
            $message = esc_html__('You do not have permission to access this page.', 'ivyforms');
        }

        parent::__construct($message, $code, $previous);
    }
}

```
