PMCORE-3332 Error message when consulting information about the cases (related to case notes)

This commit is contained in:
Roly Gutierrez
2021-09-16 21:48:00 -04:00
parent ba1aeb9f95
commit 3e0ac48049
5 changed files with 10 additions and 3 deletions

View File

@@ -2076,7 +2076,7 @@ class Cases
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
$respBlock = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'BLOCK');
if ($respView['CASES_NOTES'] == 0 && $respBlock['CASES_NOTES'] == 0) {
throw new Exception(G::LoadTranslation("ID_CASES_NOTES_NO_PERMISSIONS"));
throw new Exception(G::LoadTranslation("ID_THIS_USER_DOESNT_HAVE_PERMISSIONS_TO_SEE_CASE_NOTES"));
}
// Get the notes
$appNote = new Notes();

View File

@@ -1184,7 +1184,7 @@ class Cases extends Api
return DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
throw new RestException(401, $e->getMessage());
}
}