PM-3888-C

This commit is contained in:
Luis Fernando Saisa Lopez
2015-10-28 15:32:27 -04:00
parent b852a6cbb5
commit 7576b2ae47

View File

@@ -94,12 +94,6 @@ class Cases
Validator::usrUid($dataList["userId"], "userId");
}
$user = new \ProcessMaker\BusinessModel\User();
if (!$user->checkPermission($dataList["userId"], "PM_ALLCASES")) {
throw new \Exception(\G::LoadTranslation("ID_CASE_USER_NOT_HAVE_PERMISSION", array($dataList["userId"])));
}
G::LoadClass("applications");
$solrEnabled = false;
$userUid = $dataList["userId"];
@@ -121,6 +115,12 @@ class Cases
$dateTo = (!empty( $dataList["dateTo"] )) ? substr( $dataList["dateTo"], 0, 10 ) : "";
$first = isset( $dataList["first"] ) ? true :false;
$u = new \ProcessMaker\BusinessModel\User();
if ($action == "search" && !$u->checkPermission($dataList["userId"], "PM_ALLCASES")) {
throw new \Exception(\G::LoadTranslation("ID_CASE_USER_NOT_HAVE_PERMISSION", array($dataList["userId"])));
}
$valuesCorrect = array('todo', 'draft', 'paused', 'sent', 'selfservice', 'unassigned', 'search');
if (!in_array($action, $valuesCorrect)) {
throw (new \Exception(\G::LoadTranslation("ID_INCORRECT_VALUE_ACTION")));
@@ -2289,4 +2289,3 @@ class Cases
}
}
}