From 4bd57e420c1dedc0b6120af5240a18a6d04e84c4 Mon Sep 17 00:00:00 2001
From: sunnavy <sunnavy@bestpractical.com>
Date: Mon, 11 Dec 2023 13:41:04 -0500
Subject: [PATCH] Make sure inline edit is disabled for unprivileged users

Inline edit doesn't actually work for them anyway, because of the absent
helper component.

Previously we disabled it in /SelfService/Elements/MyRequests, which is
not enough any more as now we support various components for SelfService
especially via dashboards.
---
 share/html/Elements/CollectionList | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 273931177f4..6aaa169cdc7 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -125,7 +125,8 @@ foreach my $col (@Format) {
 
 $Class ||= $Collection->ColumnMapClassName;
 
-$InlineEdit = 0 unless $Collection->isa('RT::Tickets') || $Collection->isa('RT::Assets');
+$InlineEdit = 0
+    unless $session{CurrentUser}->Privileged && ( $Collection->isa('RT::Tickets') || $Collection->isa('RT::Assets') );
 
 $m->out('<div class="table-responsive">');
 $m->out('<table cellspacing="0"');