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

This commit is contained in:
xavier.guiboud-ribaud@combodo.com
2024-11-25 16:01:39 +01:00
committed by XGUI
parent 0d8a20c35e
commit e1bfe9a3b6
2 changed files with 13 additions and 3 deletions

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