[tools] testbot/web: Only link to the VM details page for administrators.

Francois Gouget fgouget at codeweavers.com
Fri Jun 3 12:20:14 CDT 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/index.pl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index b07b39d22..21ee5fea4 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -176,6 +176,15 @@ use ObjectModel::CGI::CollectionBlock;
 our @ISA = qw(ObjectModel::CGI::CollectionBlock);
 
 
+sub GetDetailsPage($)
+{
+  my ($self) = @_;
+  my $Session = $self->{EnclosingPage}->GetCurrentSession();
+  my $CurrentUser = $Session->User if (defined $Session);
+  return (!$CurrentUser or !$CurrentUser->HasRole("admin")) ? undef :
+         "/admin/VMDetails.pl";
+}
+
 sub DisplayProperty($$)
 {
   my ($self, $PropertyDescriptor) = @_;
-- 
2.30.2




More information about the wine-devel mailing list