N°6458 Fix portal errors

This commit is contained in:
Pierre Goiffon
2023-11-16 09:23:19 +01:00
parent e3e8b25cfc
commit 8f61c02cbe

View File

@@ -32,7 +32,6 @@ use Combodo\iTop\Form\Form;
use Combodo\iTop\Form\FormManager;
use Combodo\iTop\Portal\Helper\ApplicationHelper;
use Combodo\iTop\Portal\Helper\ObjectFormHandlerHelper;
use Combodo\iTop\Portal\Helper\SecurityHelper;
use CoreCannotSaveObjectException;
use DBObject;
use DBObjectSearch;
@@ -1136,11 +1135,10 @@ class ObjectFormManager extends FormManager
$bWasModified = $this->oObject->IsModified();
$bActivateTriggers = (!$bIsNew && $bWasModified);
/** @var SecurityHelper $oSecurityHelper */
$oSecurityHelper = $this->oContainer->get('security_helper');
$oSecurityHelper = $this->oFormHandlerHelper->getSecurityHelper();
// Forcing allowed writing on the object if necessary. This is used in some particular cases.
$bAllowWrite = $this->oFormHandlerHelper->getSecurityHelper()->IsActionAllowed($bIsNew ? UR_ACTION_CREATE : UR_ACTION_MODIFY, $sObjectClass, $this->oObject->GetKey());
$bAllowWrite = $oSecurityHelper->IsActionAllowed($bIsNew ? UR_ACTION_CREATE : UR_ACTION_MODIFY, $sObjectClass, $this->oObject->GetKey());
if ($bAllowWrite) {
$this->oObject->AllowWrite(true);
}