🐛 N°6174 Fix attachments to host objects without org_id can not be downloaded from the portal (#303)

This commit is contained in:
jbostoen
2023-04-11 18:04:48 +02:00
committed by GitHub
parent 924b28fd4c
commit cf8d675cb2

View File

@@ -1106,6 +1106,12 @@ class ObjectController extends BrickController
$oAttachment = MetaModel::GetObject($sObjectClass, $sObjectId, true, true);
$sHostClass = $oAttachment->Get('item_class');
$sHostId = $oAttachment->Get('item_id');
// Attachments could be linked to host objects without an org_id. Retrieving the attachment would fail if enforced silos are based on org_id
if($oAttachment->Get('item_org_id') === 0 && ($sHostId > 0) && $oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sHostClass, $sHostId)) {
$bCheckSecurity = false;
}
}
else
{