Merge remote-tracking branch 'origin/feature/HOR-3559' into bugfix/HOR-3282-B
This commit is contained in:
File diff suppressed because it is too large
Load Diff
59
workflow/engine/src/ProcessMaker/Exception/RBACException.php
Normal file
59
workflow/engine/src/ProcessMaker/Exception/RBACException.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Exception;
|
||||
|
||||
use G;
|
||||
|
||||
/**
|
||||
* Class PMException
|
||||
* @package ProcessMaker\Exception
|
||||
*/
|
||||
class RBACException extends \Exception
|
||||
{
|
||||
const PM_LOGIN = '../login/login';
|
||||
const PM_403 = '/errors/error403.php';
|
||||
|
||||
/**
|
||||
* RBACException constructor.
|
||||
* @param string $message
|
||||
* @param null $code
|
||||
*/
|
||||
public function __construct($message, $code=NULL)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the entire exception as a string
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
switch ($this->getCode()) {
|
||||
case -1:
|
||||
G::SendTemporalMessage($this->getMessage(), 'error', 'labels');
|
||||
$message = self::PM_LOGIN;
|
||||
break;
|
||||
case -2:
|
||||
G::SendTemporalMessage($this->getMessage(), 'error', 'labels');
|
||||
$message = self::PM_LOGIN;
|
||||
break;
|
||||
case 403:
|
||||
$message = self::PM_403;
|
||||
break;
|
||||
default:
|
||||
$message = self::PM_LOGIN;
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to which to redirect
|
||||
* @return $this
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user