From 1145e3fcd7e285cd963124d47bf05c135538d2a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCttl=C3=B6ffel?=
 <schuettloeffel@zqs.uni-hannover.de>
Date: Mon, 26 Feb 2024 12:06:41 +0000
Subject: [PATCH] Resolve "Blubber: Link zu Veranstaltungsadministration"

Closes #2530

Merge request studip/studip!1907
---
 lib/models/BlubberThread.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php
index d3a4de660a9..57b72f05e4c 100644
--- a/lib/models/BlubberThread.php
+++ b/lib/models/BlubberThread.php
@@ -478,7 +478,12 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
                 if ($module = $tool->getStudipModule()) {
                     $last_visit = object_get_visit($this['context_id'], $module->getPluginId());
                     $nav = $module->getIconNavigation($this['context_id'], $last_visit, $GLOBALS['user']->id);
-                    if (isset($nav) && $nav->isVisible(true)) {
+                    if (
+                        isset($nav)
+                        && $nav->isVisible(true)
+                        && count($module->getTabNavigation($this['context_id'])) > 0
+                        && $GLOBALS['perm']->have_studip_perm($tool->getVisibilityPermission(), $this['context_id'])
+                    ) {
                         $icons[] = $nav;
                     }
                     if ($module instanceof CoreSchedule) {
-- 
GitLab