[Rt-commit] rt branch 5.0/remove-selfservice-asset-listing-bulk-and-title-links created. rt-5.0.5-74-g4d96cf8c3d

BPS Git Server git at git.bestpractical.com
Fri Dec 8 14:28:57 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/remove-selfservice-asset-listing-bulk-and-title-links has been created
        at  4d96cf8c3dc73f733ed10e7b2b9d84b9985da5d2 (commit)

- Log -----------------------------------------------------------------
commit 4d96cf8c3dc73f733ed10e7b2b9d84b9985da5d2
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Fri Dec 8 11:26:38 2023 -0300

    Hide search and bulk update links on My Assets in self service
    
    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.

diff --git a/share/html/User/Elements/AssetList b/share/html/User/Elements/AssetList
index 44a328db48..a4c2eb4516 100644
--- a/share/html/User/Elements/AssetList
+++ b/share/html/User/Elements/AssetList
@@ -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",
 &>

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list