PM-3370 "REST endpoint GET calendars, pmtable y..." SOLVED
This commit is contained in:
@@ -13,6 +13,26 @@ class Calendar extends Api
|
||||
{
|
||||
private $formatFieldNameInUppercase = false;
|
||||
|
||||
/**
|
||||
* Constructor of the class
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
if (!$user->checkPermission($usrUid, "PM_SETUP")) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET
|
||||
*/
|
||||
@@ -21,7 +41,6 @@ class Calendar extends Api
|
||||
try {
|
||||
$calendar = new \ProcessMaker\BusinessModel\Calendar();
|
||||
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
|
||||
|
||||
$response = $calendar->getCalendars(array("filter" => $filter), null, null, $start, $limit);
|
||||
|
||||
return $response;
|
||||
@@ -40,7 +59,6 @@ class Calendar extends Api
|
||||
try {
|
||||
$calendar = new \ProcessMaker\BusinessModel\Calendar();
|
||||
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
|
||||
|
||||
$response = $calendar->getCalendar($cal_uid);
|
||||
|
||||
return $response;
|
||||
|
||||
@@ -11,6 +11,26 @@ use \Luracast\Restler\RestException;
|
||||
*/
|
||||
class Pmtable extends Api
|
||||
{
|
||||
/**
|
||||
* Constructor of the class
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
if (!$user->checkPermission($usrUid, "PM_SETUP")) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
|
||||
@@ -21,6 +21,14 @@ class ProcessCategory extends Api
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
if (!$user->checkPermission($usrUid, "PM_SETUP")) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
|
||||
}
|
||||
|
||||
$this->category = new \ProcessMaker\BusinessModel\ProcessCategory();
|
||||
|
||||
$this->category->setFormatFieldNameInUppercase(false);
|
||||
|
||||
Reference in New Issue
Block a user