Merged in gproly/processmaker/HOR-74 (pull request #4595)

HOR-74
This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-21 16:46:31 -04:00

View File

@@ -11,32 +11,14 @@ 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
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url GET
*/
public function doGetPmTables()
@@ -57,6 +39,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url GET /:pmt_uid
*/
public function doGetPmTable($pmt_uid)
@@ -79,6 +63,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url GET /:pmt_uid/data
*/
public function doGetPmTableData($pmt_uid, $filter = null, $q = "")
@@ -101,6 +87,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url POST
* @status 201
*/
@@ -130,6 +118,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url POST /:pmt_uid/data
* @status 201
*/
@@ -155,6 +145,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url PUT /:pmt_uid
*/
public function doPutPmTable(
@@ -179,6 +171,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url PUT /:pmt_uid/data
*/
public function doPutPmTableData(
@@ -202,6 +196,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url DELETE /:pmt_uid
*/
public function doDeletePmTable($pmt_uid)
@@ -228,6 +224,8 @@ class Pmtable extends Api
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @access protected
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
* @url DELETE /:pmt_uid/data/:key1/:value1
* @url DELETE /:pmt_uid/data/:key1/:value1/:key2/:value2
* @url DELETE /:pmt_uid/data/:key1/:value1/:key2/:value2/:key3/:value3