mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°2713 - Allow read access to synchro errors for users with non-admin profile - fix when object not allowed
This commit is contained in:
@@ -2835,26 +2835,25 @@ class SynchroReplica extends DBObject implements iDisplay
|
|||||||
$oPage->add('</fieldset>');
|
$oPage->add('</fieldset>');
|
||||||
|
|
||||||
$sDestClass = $this->Get('dest_class');
|
$sDestClass = $this->Get('dest_class');
|
||||||
$bIsActionAllowed = true;
|
$bCanDisplayDestObjSections = true;
|
||||||
|
|
||||||
if (strlen($sDestClass) > 0)
|
if (strlen($sDestClass) > 0)
|
||||||
{
|
{
|
||||||
$oDestObj = MetaModel::GetObject($sDestClass, $this->Get('dest_id'), false);
|
$oDestObj = MetaModel::GetObject($sDestClass, $this->Get('dest_id'), false);
|
||||||
if (is_object($oDestObj)) {
|
if (is_object($oDestObj)) {
|
||||||
$bIsActionAllowed = UserRights::IsActionAllowed($sDestClass, UR_ACTION_READ, DBObjectSet::FromObject($oDestObj));
|
$bCanDisplayDestObjSections = UserRights::IsActionAllowed($sDestClass, UR_ACTION_READ, DBObjectSet::FromObject($oDestObj));
|
||||||
} else {
|
|
||||||
$bIsActionAllowed = UserRights::IsActionAllowed($sDestClass, UR_ACTION_READ, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($bIsActionAllowed) {
|
if ($bCanDisplayDestObjSections) {
|
||||||
$oPage->add('<fieldset>');
|
$oPage->add('<fieldset>');
|
||||||
$oPage->add('<legend class="ibo-fieldset-legend">'.Dict::Format('Core:SynchroReplica:TargetObject', $oDestObj->GetHyperlink()).'</legend>');
|
$oPage->add('<legend class="ibo-fieldset-legend">'.Dict::Format('Core:SynchroReplica:TargetObject', $oDestObj->GetHyperlink()).'</legend>');
|
||||||
$oDestObj->DisplayBareProperties($oPage, false, $sPrefix, $aExtraParams);
|
$oDestObj->DisplayBareProperties($oPage, false, $sPrefix, $aExtraParams);
|
||||||
$oPage->add('<fieldset>');
|
$oPage->add('<fieldset>');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$bCanDisplayDestObjSections = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bIsActionAllowed) {
|
if ($bCanDisplayDestObjSections) {
|
||||||
$oPage->add('</div><div class="ibo-column">');
|
$oPage->add('</div><div class="ibo-column">');
|
||||||
$oPage->add('<fieldset>');
|
$oPage->add('<fieldset>');
|
||||||
$oPage->add('<legend class="ibo-fieldset-legend">'.Dict::S('Core:SynchroReplica:PublicData').'</legend>');
|
$oPage->add('<legend class="ibo-fieldset-legend">'.Dict::S('Core:SynchroReplica:PublicData').'</legend>');
|
||||||
|
|||||||
Reference in New Issue
Block a user