From 6d9014c29b14673dfe69d4ad705f1d98ac0092ba Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 7 Sep 2023 15:34:06 +0200 Subject: [PATCH] fix API permission error in navigation when customer-hide-options include 'domains'; fixes #1183 Signed-off-by: Michael Kaufmann --- lib/Froxlor/CurrentUser.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/CurrentUser.php b/lib/Froxlor/CurrentUser.php index 26c836a3..211fd470 100644 --- a/lib/Froxlor/CurrentUser.php +++ b/lib/Froxlor/CurrentUser.php @@ -151,9 +151,13 @@ class CurrentUser ]); $addition = $result['emaildomains'] != 0; } elseif ($resource == 'subdomains') { - $parentDomainCollection = (new Collection(SubDomains::class, $_SESSION['userinfo'], - ['sql_search' => ['d.parentdomainid' => 0]])); - $addition = $parentDomainCollection->count() != 0; + if (Settings::IsInList('panel.customer_hide_options', 'domains')) { + $addition = false; + } else { + $parentDomainCollection = (new Collection(SubDomains::class, $_SESSION['userinfo'], + ['sql_search' => ['d.parentdomainid' => 0]])); + $addition = $parentDomainCollection->count() != 0; + } } elseif ($resource == 'domains') { $customerCollection = (new Collection(Customers::class, $_SESSION['userinfo'])); $addition = $customerCollection != 0;