Module: tools Branch: master Commit: c134dc1579cc697df495adc533434a2123d13b8d URL: https://source.winehq.org/git/tools.git/?a=commit;h=c134dc1579cc697df495adc5...
Author: Francois Gouget fgouget@codeweavers.com Date: Fri Jun 3 19:20:14 2022 +0200
testbot/web: Only link to the VM details page for administrators.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/web/index.pl | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/testbot/web/index.pl b/testbot/web/index.pl index b07b39d..21ee5fe 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) = @_;