Fixes #4497 - FHIR search via POST (#4498)
[openemr.git] / src / Common / Acl / AccessDeniedException.php
blob7bd0815d3da75978bb84f001db32389e51f42fcb
1 <?php
3 /**
4 * AccessDeniedException represents a system exception that access was denied due to a ACL Violation
5 * @package openemr
6 * @link http://www.open-emr.org
7 * @author Stephen Nielson <stephen@nielson.org>
8 * @copyright Copyright (c) 2020 Stephen Nielson <stephen@nielson.org>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
12 namespace OpenEMR\Common\Acl;
14 use Throwable;
16 class AccessDeniedException extends \Exception
18 /**
19 * @var string
21 private $requiredSection;
23 /**
24 * @var string;
26 private $subCategory;
28 public function __construct(string $requiredSection, $subCategory = '', $message = "", $code = 0, Throwable $previous = null)
30 $this->requiredSection = $requiredSection;
31 $this->subCategory = $subCategory;
32 if (empty($message)) {
33 $message = xlt('ACL check failed');
35 parent::__construct($message, $code, $previous);
38 /**
39 * @return string
41 public function getRequiredSection(): string
43 return $this->requiredSection;
46 /**
47 * @return string
49 public function getSubCategory(): string
51 return $this->subCategory;