N°7746 - Caselog edition button active even if the user has a read-only access to the object

This commit is contained in:
XGUI
2025-01-10 11:12:03 +01:00
parent dc8f521b12
commit ec324bb28e

View File

@@ -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);
}
}