HOR-3700 fix when a permission is deleted with a case status defined
This commit is contained in:
@@ -22,22 +22,22 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*/
|
*/
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
$access = $RBAC->userCanAccess('PM_FACTORY');
|
||||||
if ($access != 1) {
|
if ($access != 1) {
|
||||||
switch ($access) {
|
switch ($access) {
|
||||||
case - 1:
|
case -1:
|
||||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header( 'location: ../login/login' );
|
G::header('location: ../login/login');
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
case - 2:
|
case -2:
|
||||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||||
G::header( 'location: ../login/login' );
|
G::header('location: ../login/login');
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header( 'location: ../login/login' );
|
G::header('location: ../login/login');
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -45,20 +45,24 @@ if ($access != 1) {
|
|||||||
try {
|
try {
|
||||||
require_once 'classes/model/ObjectPermission.php';
|
require_once 'classes/model/ObjectPermission.php';
|
||||||
$oOP = new ObjectPermission();
|
$oOP = new ObjectPermission();
|
||||||
$oOP = ObjectPermissionPeer::retrieveByPK( $_GET['OP_UID'] );
|
$oOP = ObjectPermissionPeer::retrieveByPK($_GET['OP_UID']);
|
||||||
$sProcessUID = $oOP->getProUid();
|
$sProcessUID = $oOP->getProUid();
|
||||||
$oOP->delete();
|
$oOP->delete();
|
||||||
|
|
||||||
|
$result = new stdclass();
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->msg = G::LoadTranslation( 'ID_REPORTTABLE_REMOVED' );
|
$result->msg = G::LoadTranslation('ID_REPORTTABLE_REMOVED');
|
||||||
|
|
||||||
$oProcessMap = new ProcessMap();
|
$oProcessMap = new ProcessMap();
|
||||||
$oProcessMap->getObjectsPermissionsCriteria( $sProcessUID );
|
$oProcessMap->getObjectsPermissionsCriteria($sProcessUID);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
$result = new stdclass();
|
||||||
$result->success = false;
|
$result->success = false;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
}
|
}
|
||||||
print G::json_encode( $result );
|
print G::json_encode($result);
|
||||||
|
|
||||||
$infoProcess = new Processes();
|
$infoProcess = new Processes();
|
||||||
$resultProcess = $infoProcess->getProcessRow($sProcessUID);
|
$resultProcess = $infoProcess->getProcessRow($sProcessUID);
|
||||||
G::auditLog('DeletePermissions','Delete Permissions ('.$_GET['OP_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
G::auditLog('DeletePermissions',
|
||||||
|
'Delete Permissions (' . $_GET['OP_UID'] . ') in Process "' . $resultProcess['PRO_TITLE'] . '"');
|
||||||
|
|||||||
Reference in New Issue
Block a user