Merged in paulis/processmaker/HOR-1877 (pull request #4929)

HOR-1877
This commit is contained in:
Julio Cesar Laura Avendaño
2016-09-21 11:42:03 -04:00
2 changed files with 14 additions and 0 deletions

View File

@@ -38,7 +38,19 @@ class Cases extends Api
case 'doGetCaseVariables':
$applicationUid = $this->parameters[$arrayArgs['app_uid']];
$dynaformUid = $this->parameters[$arrayArgs['dyn_uid']];
$delIndex = $this->parameters[$arrayArgs['app_index']];
$userUid = $this->getUserId();
//Check if the user has the case
$appDelegation = new \AppDelegation();
$aCurUser = $appDelegation->getCurrentUsers($applicationUid, $delIndex);
if (!empty($aCurUser)) {
foreach ($aCurUser as $key => $value) {
if ($value === $userUid) {
return true;
}
}
}
//Check if the user has Permissions
$oCases = new \ProcessMaker\BusinessModel\Cases();
return $oCases->checkUserHasPermissionsOrSupervisor($userUid, $applicationUid, $dynaformUid);
break;