Skip to content

Commit

Permalink
Hide search and bulk update links on My Assets in self service
Browse files Browse the repository at this point in the history
My Assets is used in self service and in regular RT. Self service users
do not have access to the asset query builder, so render links to the
search and bulk update only for privileged users.
  • Loading branch information
richieri-bps committed Dec 8, 2023
1 parent eeb33b2 commit 4d96cf8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions share/html/User/Elements/AssetList
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,23 @@ my $query_string = $m->comp('/Elements/QueryString',
Order => $QueryProperties{Order},
);

my $search_url =
RT->Config->Get('WebPath') .
'/Search/Results.html?' .
$query_string;
my ($search_url, $bulk_update_title, $bulk_update_url);

my $bulk_update_url =
RT->Config->Get('WebPath') .
'/Asset/Search/Bulk.html?' .
$query_string;
if ($session{CurrentUser}->Privileged) {
$search_url = RT->Config->Get('WebPath') .
'/Search/Results.html?' .
$query_string;
$bulk_update_title = loc('Bulk Update');
$bulk_update_url = RT->Config->Get('WebPath') .
'/Asset/Search/Bulk.html?' .
$query_string;
}

</%init>
<&| /Widgets/TitleBox,
title => $Title,
title_href => $search_url,
titleright => loc('Bulk Update'),
titleright => $bulk_update_title,
titleright_href => $bulk_update_url,
class => "user asset-list",
&>
Expand Down

0 comments on commit 4d96cf8

Please sign in to comment.