PM-2113 "REST endpoint GET /cases/advanced-search" SOLVED
> Code Isuue:
0017019: REST endpoint GET /cases/advanced-search doesn't check whether user has PM_ALLCASES permission in role
> Solution:
Se agrega validacion en el siguiente Endpoint cuando se utiliza el servicio REST, el mismo mostrara un mensaje indicando
que el usuario no esta autorizado para realizar la accion.
GET /api/1.0/{workspace}/cases/advanced-search
This commit is contained in:
@@ -336,10 +336,10 @@ class User
|
||||
//Get Calendar
|
||||
$calendar = new \Calendar();
|
||||
$calendarInfo = $calendar->getCalendarFor( $record["USR_UID"], "", "" );
|
||||
$aFields["USR_CALENDAR_UID"] = ($calendarInfo["CALENDAR_APPLIED"] != "DEFAULT") ? $calendarInfo["CALENDAR_UID"] : "";
|
||||
$aFields["USR_CALENDAR_UID"] = ($calendarInfo["CALENDAR_APPLIED"] != "DEFAULT") ? $calendarInfo["CALENDAR_UID"] : "";
|
||||
$aFields["USR_CALENDAR"] = ($aFields["USR_CALENDAR_UID"] != "") ? $calendar->calendarName( $aFields["USR_CALENDAR_UID"] ) : $aFields["USR_CALENDAR_UID"];
|
||||
|
||||
//Get photo
|
||||
//Get photo
|
||||
$pathPhotoUser = PATH_IMAGES_ENVIRONMENT_USERS . $record["USR_UID"] . ".gif";
|
||||
if (! file_exists( $pathPhotoUser )) {
|
||||
$pathPhotoUser = PATH_HOME . "public_html" . PATH_SEP . "images" . PATH_SEP . "user.gif";
|
||||
@@ -1116,4 +1116,33 @@ class User
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
*
|
||||
* @param string $userUid Unique uid of User
|
||||
* @param string $permissionCode Permission code
|
||||
*
|
||||
* return bool
|
||||
*/
|
||||
public function checkPermission($userUid, $permissionCode)
|
||||
{
|
||||
try {
|
||||
$flagPermission = false;
|
||||
|
||||
$arrayUserRolePermission = $this->loadUserRolePermission("PROCESSMAKER", $userUid);
|
||||
|
||||
foreach ($arrayUserRolePermission as $value) {
|
||||
if ($value["PER_CODE"] == $permissionCode) {
|
||||
$flagPermission = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
return $flagPermission;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user