mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°7023 - Fix regression from the initial fix that throw exceptions even for ext. keys set programatically (eg. ComputeValues), which we still want to allow
This commit is contained in:
@@ -1150,9 +1150,6 @@ class ObjectFormManager extends FormManager
|
||||
// Writing object to DB
|
||||
try
|
||||
{
|
||||
$this->oObject->CheckChangedExtKeysValues(function ($sClass, $sId) use ($oSecurityHelper): bool {
|
||||
return $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $sId);
|
||||
});
|
||||
$this->oObject->DBWrite();
|
||||
} catch (CoreCannotSaveObjectException $e) {
|
||||
throw new Exception($e->getHtmlMessage());
|
||||
@@ -1371,6 +1368,12 @@ class ObjectFormManager extends FormManager
|
||||
}
|
||||
}
|
||||
}
|
||||
/** @var SecurityHelper $oSecurityHelper */
|
||||
$oSecurityHelper = $this->oContainer->get('security_helper');
|
||||
// N°7023 - Note that we check for ext. key now as we want the check to be done on user inputs and NOT on ext. keys set programatically, so it must be done before the DoComputeValues
|
||||
$this->oObject->CheckChangedExtKeysValues(function ($sClass, $sId) use ($oSecurityHelper): bool {
|
||||
return $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sClass, $sId);
|
||||
});
|
||||
$this->oObject->DoComputeValues();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user