From ec324bb28e12a86fdb9bc09316e8c45721a04af6 Mon Sep 17 00:00:00 2001 From: XGUI Date: Fri, 10 Jan 2025 11:12:03 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B07746=20-=20Caselog=20edition=20button=20?= =?UTF-8?q?active=20even=20if=20the=20user=20has=20a=20read-only=20access?= =?UTF-8?q?=20to=20the=20object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Base/Layout/ActivityPanel/ActivityPanel.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sources/Application/UI/Base/Layout/ActivityPanel/ActivityPanel.php b/sources/Application/UI/Base/Layout/ActivityPanel/ActivityPanel.php index 2d38da682..ef70eecb6 100644 --- a/sources/Application/UI/Base/Layout/ActivityPanel/ActivityPanel.php +++ b/sources/Application/UI/Base/Layout/ActivityPanel/ActivityPanel.php @@ -763,7 +763,7 @@ class ActivityPanel extends UIBlock */ public function IsComposeButtonEnabled(): bool { - return $this->HasAnEditableCaseLogTab() && $this->IsCaseLogsSubmitAutonomous(); + return $this->HasAnEditableCaseLogTab() && $this->IsCaseLogsSubmitAutonomous() && $this->HasUserModifyRights(); } /** @@ -974,4 +974,14 @@ class ActivityPanel extends UIBlock $this->bShowMultipleEntriesSubmitConfirmation = appUserPreferences::GetPref('activity_panel.show_multiple_entries_submit_confirmation', static::DEFAULT_SHOW_MULTIPLE_ENTRIES_SUBMI_CONFIRMATION) !== 'false'; return $this; } + + + /** + * @return bool + * @throws \CoreException + */ + protected function HasUserModifyRights(): bool + { + return \UserRights::IsActionAllowed($this->GetObjectClass(), UR_ACTION_MODIFY); + } } \ No newline at end of file