From 86ab7bd05efe3fdfbfc810071a46d3d52b55e5f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Mon, 17 Feb 2025 15:42:00 +0100
Subject: [PATCH] tweak(Tinebase/EvalDim): only check right if user is
available
... this would fail in uninstall otherwise
---
tine20/Tinebase/Controller/EvaluationDimension.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tine20/Tinebase/Controller/EvaluationDimension.php b/tine20/Tinebase/Controller/EvaluationDimension.php
index 5739dd67f10..6b312ca39d1 100644
--- a/tine20/Tinebase/Controller/EvaluationDimension.php
+++ b/tine20/Tinebase/Controller/EvaluationDimension.php
@@ -56,8 +56,10 @@ protected function _checkRight($_action)
return;
}
- if (!Tinebase_Core::getUser()
- ->hasRight(Tinebase_Config::APP_NAME, Tinebase_Acl_Rights::MANAGE_EVALUATION_DIMENSIONS)) {
+ $user = Tinebase_Core::getUser();
+ if (is_object($user) && ! $user->hasRight(
+ Tinebase_Config::APP_NAME, Tinebase_Acl_Rights::MANAGE_EVALUATION_DIMENSIONS)
+ ) {
throw new Tinebase_Exception_AccessDenied('no right to ' . $_action . ' evaluation dimensions');
}
}