From 5dcbb23467613073ba76f81713a718dff130cc22 Mon Sep 17 00:00:00 2001 From: "lenaick.moreira" Date: Mon, 18 May 2026 16:33:45 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B09614=20-=20Display=20the=20icon=20in=20E?= =?UTF-8?q?ventNotificationNewsroom=20only=20for=20events=20relating=20to?= =?UTF-8?q?=20the=20logged-in=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Newsroom/iTopNewsroomController.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sources/Controller/Newsroom/iTopNewsroomController.php b/sources/Controller/Newsroom/iTopNewsroomController.php index d517b07d17..6b5003a856 100644 --- a/sources/Controller/Newsroom/iTopNewsroomController.php +++ b/sources/Controller/Newsroom/iTopNewsroomController.php @@ -715,15 +715,18 @@ HTML; $oPage->add_header('Content-Security-Policy: sandbox;'); } - ormDocument::DownloadDocument( - $oPage, - EventNotificationNewsroom::class, - $sId, - 'icon', - ormDocument::ENUM_CONTENT_DISPOSITION_INLINE, - bAllowAllData: true - ); - $oPage->output(); + $oEvent = MetaModel::GetObject(EventNotificationNewsroom::class, $sId, false, true); + if (($oEvent !== null) && ($oEvent->Get('contact_id') === UserRights::GetContactId())) { + ormDocument::DownloadDocument( + $oPage, + EventNotificationNewsroom::class, + $sId, + 'icon', + ormDocument::ENUM_CONTENT_DISPOSITION_INLINE, + bAllowAllData: true + ); + $oPage->output(); + } } }