PMCORE-3512 Any user can claim a case

This commit is contained in:
Roly Rudy Gutierrez Pinto
2021-11-09 11:08:01 -04:00
parent 6d8c62a18f
commit 12f10ef3a9

View File

@@ -1134,6 +1134,13 @@ class Cases
if (empty($delegation['USR_UID'])) {
$case = new ClassesCases();
$case->loadCase($appUid);
//Review if the user can be claim the case
if (!$case->isSelfService($userUid, $delegation['TAS_UID'], $appUid)) {
$message = preg_replace("#<br\s*/?>#i", "", G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED"));
throw new Exception($message);
}
$case->setCatchUser($appUid, $index, $userUid);
} else {
throw new Exception(G::LoadTranslation("ID_CASE_USER_INVALID_CLAIM_CASE", [$userUid]));