Correcion de Process Permissions
This commit is contained in:
@@ -15,8 +15,8 @@ class ProcessPermissions
|
|||||||
/**
|
/**
|
||||||
* Get list for Process Permissions
|
* Get list for Process Permissions
|
||||||
*
|
*
|
||||||
* @var string $sProcessUID. Uid for Process
|
* @var string $pro_uid. Uid for Process
|
||||||
* @var string $sPermissionUid. Uid for Process Permission
|
* @var string $op_uid. Uid for Process Permission
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -24,15 +24,20 @@ class ProcessPermissions
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getProcessPermissions($sProcessUID, $sPermissionUid = '')
|
public function getProcessPermissions($pro_uid, $op_uid = '')
|
||||||
{
|
{
|
||||||
|
$pro_uid = $this->validateProUid($pro_uid);
|
||||||
|
if ($op_uid != '') {
|
||||||
|
$op_uid = $this->validateOpUid($op_uid);
|
||||||
|
}
|
||||||
|
|
||||||
G::LoadClass('case');
|
G::LoadClass('case');
|
||||||
Cases::verifyTable();
|
Cases::verifyTable();
|
||||||
$aObjectsPermissions = array();
|
$aObjectsPermissions = array();
|
||||||
$oCriteria = new \Criteria('workflow');
|
$oCriteria = new \Criteria('workflow');
|
||||||
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $sProcessUID);
|
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $pro_uid);
|
||||||
if ($sPermissionUid != '') {
|
if ($op_uid != '') {
|
||||||
$oCriteria->add(ObjectPermissionPeer::OP_UID, $sPermissionUid);
|
$oCriteria->add(ObjectPermissionPeer::OP_UID, $op_uid);
|
||||||
}
|
}
|
||||||
$oDataset = ObjectPermissionPeer::doSelectRS($oCriteria);
|
$oDataset = ObjectPermissionPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
@@ -170,9 +175,9 @@ class ProcessPermissions
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sPermissionUid != '' && empty($aObjectsPermissions)) {
|
if ($op_uid != '' && empty($aObjectsPermissions)) {
|
||||||
throw (new \Exception( 'This row doesn\'t exist!' ));
|
throw (new \Exception( 'This row doesn\'t exist!' ));
|
||||||
} elseif ($sPermissionUid != '' && !empty($aObjectsPermissions)) {
|
} elseif ($op_uid != '' && !empty($aObjectsPermissions)) {
|
||||||
$aObjectsPermissions = array_change_key_case($aObjectsPermissions, CASE_LOWER);
|
$aObjectsPermissions = array_change_key_case($aObjectsPermissions, CASE_LOWER);
|
||||||
return current($aObjectsPermissions);
|
return current($aObjectsPermissions);
|
||||||
}
|
}
|
||||||
@@ -184,7 +189,7 @@ class ProcessPermissions
|
|||||||
* Save Process Permission
|
* Save Process Permission
|
||||||
*
|
*
|
||||||
* @var array $data. Data for Process Permission
|
* @var array $data. Data for Process Permission
|
||||||
* @var string $sPermissionUid. Uid for Process Permission
|
* @var string $op_uid. Uid for Process Permission
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -193,20 +198,27 @@ class ProcessPermissions
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function saveProcessPermission($data, $sPermissionUid = '')
|
public function saveProcessPermission($data, $op_uid = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = array_change_key_case($data, CASE_UPPER);
|
$data = array_change_key_case($data, CASE_UPPER);
|
||||||
|
|
||||||
$this->validateProcess($data['PRO_UID']);
|
$this->validateProUid($data['PRO_UID']);
|
||||||
$this->validateUser($data['USR_UID']);
|
if ($op_uid != '') {
|
||||||
|
$op_uid = $this->validateOpUid($op_uid);
|
||||||
|
}
|
||||||
|
if ($data['OP_USER_RELATION'] == "1") {
|
||||||
|
$this->validateUsrUid($data['USR_UID']);
|
||||||
|
} else {
|
||||||
|
$this->validateGrpUid($data['USR_UID']);
|
||||||
|
}
|
||||||
if (isset($data['TAS_UID']) && ($data['TAS_UID'] != '')) {
|
if (isset($data['TAS_UID']) && ($data['TAS_UID'] != '')) {
|
||||||
$this->validateTask($data['TAS_UID']);
|
$this->validateTasUid($data['TAS_UID']);
|
||||||
} else {
|
} else {
|
||||||
$data['TAS_UID'] = '';
|
$data['TAS_UID'] = '';
|
||||||
}
|
}
|
||||||
if (isset($data['OP_TASK_SOURCE']) && ($data['OP_TASK_SOURCE'] != '')) {
|
if (isset($data['OP_TASK_SOURCE']) && ($data['OP_TASK_SOURCE'] != '')) {
|
||||||
$this->validateTask($data['OP_TASK_SOURCE']);
|
$this->validateTasUid($data['OP_TASK_SOURCE']);
|
||||||
} else {
|
} else {
|
||||||
$data['OP_TASK_SOURCE'] = '';
|
$data['OP_TASK_SOURCE'] = '';
|
||||||
}
|
}
|
||||||
@@ -220,24 +232,24 @@ class ProcessPermissions
|
|||||||
$sObjectUID = '';
|
$sObjectUID = '';
|
||||||
break;
|
break;
|
||||||
case 'DYNAFORM':
|
case 'DYNAFORM':
|
||||||
$this->validateDynaform($data['DYNAFORMS']);
|
$this->validateDynUid($data['DYNAFORMS']);
|
||||||
$sObjectUID = $data['DYNAFORMS'];
|
$sObjectUID = $data['DYNAFORMS'];
|
||||||
break;
|
break;
|
||||||
case 'INPUT':
|
case 'INPUT':
|
||||||
$this->validateInput($data['INPUTS']);
|
$this->validateInpUid($data['INPUTS']);
|
||||||
$sObjectUID = $data['INPUTS'];
|
$sObjectUID = $data['INPUTS'];
|
||||||
break;
|
break;
|
||||||
case 'OUTPUT':
|
case 'OUTPUT':
|
||||||
$this->validateOutput($data['OUTPUTS']);
|
$this->validateOutUid($data['OUTPUTS']);
|
||||||
$sObjectUID = $data['OUTPUTS'];
|
$sObjectUID = $data['OUTPUTS'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$oOP = new \ObjectPermission();
|
$oOP = new \ObjectPermission();
|
||||||
$permissionUid = ($sPermissionUid != '') ? $sPermissionUid : G::generateUniqueID();
|
$permissionUid = ($op_uid != '') ? $op_uid : G::generateUniqueID();
|
||||||
$data['OP_UID'] = $permissionUid;
|
$data['OP_UID'] = $permissionUid;
|
||||||
$data['OP_OBJ_UID'] = $sObjectUID;
|
$data['OP_OBJ_UID'] = $sObjectUID;
|
||||||
|
|
||||||
if ($sPermissionUid == '') {
|
if ($op_uid == '') {
|
||||||
$oOP->fromArray( $data, \BasePeer::TYPE_FIELDNAME );
|
$oOP->fromArray( $data, \BasePeer::TYPE_FIELDNAME );
|
||||||
$oOP->save();
|
$oOP->save();
|
||||||
$daraRes = $oOP->load($permissionUid);
|
$daraRes = $oOP->load($permissionUid);
|
||||||
@@ -261,7 +273,7 @@ class ProcessPermissions
|
|||||||
/**
|
/**
|
||||||
* Delete Process Permission
|
* Delete Process Permission
|
||||||
*
|
*
|
||||||
* @var string $sPermissionUid. Uid for Process Permission
|
* @var string $op_uid. Uid for Process Permission
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -269,100 +281,186 @@ class ProcessPermissions
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function deleteProcessPermission($sPermissionUid)
|
public function deleteProcessPermission($op_uid, $pro_uid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
require_once 'classes/model/ObjectPermission.php';
|
$pro_uid = $this->validateProUid($pro_uid);
|
||||||
|
$op_uid = $this->validateOpUid($op_uid);
|
||||||
|
|
||||||
$oOP = new \ObjectPermission();
|
$oOP = new \ObjectPermission();
|
||||||
$oOP = ObjectPermissionPeer::retrieveByPK( $sPermissionUid );
|
$oOP = ObjectPermissionPeer::retrieveByPK( $op_uid );
|
||||||
$oOP->delete();
|
$oOP->delete();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateProcess($proUid) {
|
/**
|
||||||
$proUid = trim($proUid);
|
* Validate Process Uid
|
||||||
if ($proUid == '') {
|
* @var string $pro_uid. Uid for process
|
||||||
throw (new \Exception('This process doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateProUid ($pro_uid) {
|
||||||
|
$pro_uid = trim($pro_uid);
|
||||||
|
if ($pro_uid == '') {
|
||||||
|
throw (new \Exception("The project with prj_uid: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$oProcess = new \Process();
|
$oProcess = new \Process();
|
||||||
if (!($oProcess->processExists($proUid))) {
|
if (!($oProcess->processExists($pro_uid))) {
|
||||||
throw (new \Exception('This process doesn\'t exist!'));
|
throw (new \Exception("The project with prj_uid: '$pro_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $pro_uid;
|
||||||
return $proUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateUser($userUid) {
|
/**
|
||||||
$userUid = trim($userUid);
|
* Validate Process Permission Uid
|
||||||
if ($userUid == '') {
|
* @var string $op_uid. Uid for process permission
|
||||||
throw (new \Exception('This user doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateOpUid ($op_uid) {
|
||||||
|
$op_uid = trim($op_uid);
|
||||||
|
if ($op_uid == '') {
|
||||||
|
throw (new \Exception("The process permission with op_uid: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
$oObjectPermission = new \ObjectPermission();
|
||||||
|
if (!($oObjectPermission->Exists($op_uid))) {
|
||||||
|
throw (new \Exception("The process permission with op_uid: '$op_uid', does not exist."));
|
||||||
|
}
|
||||||
|
return $op_uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate User Uid
|
||||||
|
* @var string $usr_uid. Uid for user
|
||||||
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateUsrUid($usr_uid) {
|
||||||
|
$usr_uid = trim($usr_uid);
|
||||||
|
if ($usr_uid == '') {
|
||||||
|
throw (new \Exception("The user with usr_uid: '', does not exist."));
|
||||||
|
}
|
||||||
$oUsers = new \Users();
|
$oUsers = new \Users();
|
||||||
if (!($oUsers->userExists($userUid))) {
|
if (!($oUsers->userExists($usr_uid))) {
|
||||||
throw (new \Exception('This user doesn\'t exist!'));
|
throw (new \Exception("The user with usr_uid: '$usr_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $usr_uid;
|
||||||
return $userUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateTask($taskUid) {
|
/**
|
||||||
$taskUid = trim($taskUid);
|
* Validate Group Uid
|
||||||
if ($taskUid == '') {
|
* @var string $grp_uid. Uid for group
|
||||||
throw (new \Exception('This task doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateGrpUid($grp_uid) {
|
||||||
|
$grp_uid = trim($grp_uid);
|
||||||
|
if ($grp_uid == '') {
|
||||||
|
throw (new \Exception("The group with usr_uid: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
$oGroup = new \Groupwf();
|
||||||
|
if (!($oGroup->GroupwfExists($grp_uid))) {
|
||||||
|
throw (new \Exception("The group with usr_uid: '$grp_uid', does not exist."));
|
||||||
|
}
|
||||||
|
return $grp_uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate Task Uid
|
||||||
|
* @var string $tas_uid. Uid for task
|
||||||
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateTasUid($tas_uid) {
|
||||||
|
$tas_uid = trim($tas_uid);
|
||||||
|
if ($tas_uid == '') {
|
||||||
|
throw (new \Exception("The task with tas_uid: '', does not exist."));
|
||||||
|
}
|
||||||
$oTask = new \Task();
|
$oTask = new \Task();
|
||||||
if (!($oTask->taskExists($taskUid))) {
|
if (!($oTask->taskExists($tas_uid))) {
|
||||||
throw (new \Exception('This task doesn\'t exist!'));
|
throw (new \Exception("The task with tas_uid: '$tas_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $tas_uid;
|
||||||
return $taskUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateDynaform($dynUid) {
|
/**
|
||||||
$dynUid = trim($dynUid);
|
* Validate Dynaform Uid
|
||||||
if ($dynUid == '') {
|
* @var string $dyn_uid. Uid for dynaform
|
||||||
throw (new \Exception('This dynaform doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateDynUid($dyn_uid) {
|
||||||
|
$dyn_uid = trim($dyn_uid);
|
||||||
|
if ($dyn_uid == '') {
|
||||||
|
throw (new \Exception("The dynaform with dynaforms: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDynaform = new \Dynaform();
|
$oDynaform = new \Dynaform();
|
||||||
if (!($oDynaform->dynaformExists($dynUid))) {
|
if (!($oDynaform->dynaformExists($dyn_uid))) {
|
||||||
throw (new \Exception('This dynaform doesn\'t exist!'));
|
throw (new \Exception("The dynaform with dynaforms: '$dyn_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $dyn_uid;
|
||||||
return $dynUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateInput($inputUid) {
|
/**
|
||||||
$inputUid = trim($inputUid);
|
* Validate Input Uid
|
||||||
if ($inputUid == '') {
|
* @var string $inp_uid. Uid for dynaform
|
||||||
throw (new \Exception('This inputDocument doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateInpUid($inp_uid) {
|
||||||
|
$inp_uid = trim($inp_uid);
|
||||||
|
if ($inp_uid == '') {
|
||||||
|
throw (new \Exception("The input with inputs: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$oInputDocument = new \InputDocument();
|
$oInputDocument = new \InputDocument();
|
||||||
if (!($oInputDocument->InputExists($inputUid))) {
|
if (!($oInputDocument->InputExists($inp_uid))) {
|
||||||
throw (new \Exception('This inputDocument doesn\'t exist!'));
|
throw (new \Exception("The input with inputs: '$inp_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $inp_uid;
|
||||||
return $inputUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateOutput($outputUid) {
|
/**
|
||||||
$outputUid = trim($outputUid);
|
* Validate Output Uid
|
||||||
if ($outputUid == '') {
|
* @var string $out_uid. Uid for output
|
||||||
throw (new \Exception('This task doesn\'t exist!'));
|
*
|
||||||
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
|
* @copyright Colosa - Bolivia
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function validateOutUid($out_uid) {
|
||||||
|
$out_uid = trim($out_uid);
|
||||||
|
if ($out_uid == '') {
|
||||||
|
throw (new \Exception("The output with outputs: '', does not exist."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$oOutputDocument = new \OutputDocument();
|
$oOutputDocument = new \OutputDocument();
|
||||||
if (!($oOutputDocument->OutputExists($outputUid))) {
|
if (!($oOutputDocument->OutputExists($out_uid))) {
|
||||||
throw (new \Exception('This task doesn\'t exist!'));
|
throw (new \Exception("The output with outputs: '$out_uid', does not exist."));
|
||||||
}
|
}
|
||||||
|
return $out_uid;
|
||||||
return $outputUid;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use \Luracast\Restler\RestException;
|
|||||||
class ProcessPermissions extends Api
|
class ProcessPermissions extends Api
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param string $projectUid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -25,11 +25,11 @@ class ProcessPermissions extends Api
|
|||||||
*
|
*
|
||||||
* @url GET /:projectUid/process-permissions
|
* @url GET /:projectUid/process-permissions
|
||||||
*/
|
*/
|
||||||
public function doGetProcessPermissions($projectUid)
|
public function doGetProcessPermissions($prj_uid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||||
$response = $processPermissions->getProcessPermissions($projectUid);
|
$response = $processPermissions->getProcessPermissions($prj_uid);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
@@ -37,8 +37,8 @@ class ProcessPermissions extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $projectUid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
* @param string $objectPermissionUid {@min 1} {@max 32}
|
* @param string $ob_uid {@min 1} {@max 32}
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -46,13 +46,13 @@ class ProcessPermissions extends Api
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @url GET /:projectUid/process-permission/:objectPermissionUid
|
* @url GET /:prj_uid/process-permission/:ob_uid
|
||||||
*/
|
*/
|
||||||
public function doGetProcessPermission($projectUid, $objectPermissionUid)
|
public function doGetProcessPermission($prj_uid, $ob_uid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||||
$response = $processPermissions->getProcessPermissions($projectUid, $objectPermissionUid);
|
$response = $processPermissions->getProcessPermissions($prj_uid, $ob_uid);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
@@ -60,7 +60,7 @@ class ProcessPermissions extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $projectUid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
* @param array $request_data
|
* @param array $request_data
|
||||||
*
|
*
|
||||||
* @param string $usr_uid {@from body} {@min 1} {@max 32}
|
* @param string $usr_uid {@from body} {@min 1} {@max 32}
|
||||||
@@ -81,11 +81,11 @@ class ProcessPermissions extends Api
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @url POST /:projectUid/process-permission/
|
* @url POST /:prj_uid/process-permission/
|
||||||
* @status 201
|
* @status 201
|
||||||
*/
|
*/
|
||||||
public function doPostProcessPermission(
|
public function doPostProcessPermission(
|
||||||
$projectUid,
|
$prj_uid,
|
||||||
$request_data,
|
$request_data,
|
||||||
$usr_uid,
|
$usr_uid,
|
||||||
$op_user_relation,
|
$op_user_relation,
|
||||||
@@ -103,7 +103,7 @@ class ProcessPermissions extends Api
|
|||||||
$hiddenFields = array('task_target', 'group_user', 'task_source',
|
$hiddenFields = array('task_target', 'group_user', 'task_source',
|
||||||
'object_type', 'object', 'participated', 'action'
|
'object_type', 'object', 'participated', 'action'
|
||||||
);
|
);
|
||||||
$request_data['pro_uid'] = $projectUid;
|
$request_data['pro_uid'] = $prj_uid;
|
||||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||||
$response = $processPermissions->saveProcessPermission($request_data);
|
$response = $processPermissions->saveProcessPermission($request_data);
|
||||||
foreach ($response as $key => $eventData) {
|
foreach ($response as $key => $eventData) {
|
||||||
@@ -118,8 +118,8 @@ class ProcessPermissions extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $projectUid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
* @param string $objectPermissionUid {@min 1} {@max 32}
|
* @param string $ob_uid {@min 1} {@max 32}
|
||||||
* @param array $request_data
|
* @param array $request_data
|
||||||
*
|
*
|
||||||
* @param string $usr_uid {@from body} {@min 1} {@max 32}
|
* @param string $usr_uid {@from body} {@min 1} {@max 32}
|
||||||
@@ -140,11 +140,11 @@ class ProcessPermissions extends Api
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @url PUT /:projectUid/process-permission/:objectPermissionUid
|
* @url PUT /:prj_uid/process-permission/:ob_uid
|
||||||
*/
|
*/
|
||||||
public function doPutProcessPermission(
|
public function doPutProcessPermission(
|
||||||
$projectUid,
|
$prj_uid,
|
||||||
$objectPermissionUid,
|
$ob_uid,
|
||||||
$request_data,
|
$request_data,
|
||||||
$usr_uid,
|
$usr_uid,
|
||||||
$op_user_relation,
|
$op_user_relation,
|
||||||
@@ -159,9 +159,9 @@ class ProcessPermissions extends Api
|
|||||||
$outputs = ''
|
$outputs = ''
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
$request_data['pro_uid'] = $projectUid;
|
$request_data['pro_uid'] = $prj_uid;
|
||||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||||
$response = $processPermissions->saveProcessPermission($request_data, $objectPermissionUid);
|
$response = $processPermissions->saveProcessPermission($request_data, $ob_uid);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
@@ -169,8 +169,8 @@ class ProcessPermissions extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $projectUid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
* @param string $objectPermissionUid {@min 1} {@max 32}
|
* @param string $ob_uid {@min 1} {@max 32}
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
@@ -178,13 +178,13 @@ class ProcessPermissions extends Api
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @url DELETE /:projectUid/process-permission/:objectPermissionUid
|
* @url DELETE /:prj_uid/process-permission/:ob_uid
|
||||||
*/
|
*/
|
||||||
public function doDeleteProcessPermission($projectUid, $objectPermissionUid)
|
public function doDeleteProcessPermission($prj_uid, $ob_uid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||||
$response = $processPermissions->deleteProcessPermission($objectPermissionUid, $projectUid);
|
$response = $processPermissions->deleteProcessPermission($ob_uid, $prj_uid);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
|
|||||||
Reference in New Issue
Block a user