PM-2114 "0017023: REST endpoint GET /cases/{app_uid} doesn't..." SOLVED

Issue:
    PM-2114: 0017023: REST endpoint GET /cases/{app_uid} doesn't check whether user has permission to access case
    PM-2115: 0017027: REST endpoint GET /cases/{app_uid} returns an empty response if case has "CANCELLED" or "COMPLETED" status
Cause:
    PM-2114: No existe validacion para el usuario
    PM-2115: No se a considerado cuando un caso tiene un estado PAUSED, CANCELLED o COMPLETED
Solution:
    PM-2114: Se agrega validacion para el usuario
    PM-2115: Se a completado en el metodo "getCaseInfo" para los estados PAUSED, CANCELLED o COMPLETED
This commit is contained in:
Victor Saisa Lopez
2015-04-10 10:07:22 -04:00
parent 7ca6cb9a13
commit 420acd83dd
3 changed files with 157 additions and 31 deletions

View File

@@ -1012,9 +1012,11 @@ class wsBase
*
* @param string $caseId
* @param string $iDelIndex
* @param bool $flagUseDelIndex
*
* @return $result will return an object
*/
public function getCaseInfo ($caseId, $iDelIndex)
public function getCaseInfo($caseId, $iDelIndex, $flagUseDelIndex = false)
{
try {
$oCase = new Cases();
@@ -1060,7 +1062,12 @@ class wsBase
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
if ($flagUseDelIndex) {
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelIndex, Criteria::EQUAL);
} else {
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
}
$oCriteria->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
@@ -3308,3 +3315,4 @@ class wsBase
}
}
}