Francois Gouget : testbot/web: Add support for adding and removing roles.

Alexandre Julliard julliard at winehq.org
Tue May 24 15:44:44 CDT 2022


Module: tools
Branch: master
Commit: 500584f25168a9f65037ac7100862167b88c08e2
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=500584f25168a9f65037ac7100862167b88c08e2

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue May 24 20:40:38 2022 +0200

testbot/web: Add support for adding and removing roles.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/CGI/PageBase.pm |  2 ++
 testbot/web/admin/RoleDetails.pl        | 42 +++++++++++++++++++++++++++++++++
 testbot/web/admin/RolesList.pl          | 30 +++++++++++++++++++++++
 3 files changed, 74 insertions(+)

diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index c42a4f2..40f5197 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -559,6 +559,8 @@ EOF
           "'>Special Jobs</a></p></li>\n";
     print "        <li><p><a href='", MakeSecureURL("/admin/UsersList.pl"),
           "'>Users</a></p></li>\n";
+    print "        <li><p><a href='", MakeSecureURL("/admin/RolesList.pl"),
+          "'>Roles</a></p></li>\n";
     print "        <li class='divider'> </li>\n";
     print "        <li><p><a href='", MakeSecureURL("/admin/VMsList.pl"),
           "'>VMs</a></p></li>\n";
diff --git a/testbot/web/admin/RoleDetails.pl b/testbot/web/admin/RoleDetails.pl
new file mode 100644
index 0000000..3f6d02e
--- /dev/null
+++ b/testbot/web/admin/RoleDetails.pl
@@ -0,0 +1,42 @@
+# -*- Mode: Perl; perl-indent-level: 2; indent-tabs-mode: nil -*-
+# Role details page
+#
+# Copyright 2010 VMware, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+use strict;
+
+package RoleDetailsPage;
+
+use ObjectModel::CGI::ItemPage;
+our @ISA = qw(ObjectModel::CGI::ItemPage);
+
+use WineTestBot::Roles;
+
+
+sub _initialize($$$)
+{
+  my ($self, $Request, $RequiredRole) = @_;
+
+  $self->SUPER::_initialize($Request, $RequiredRole, CreateRoles());
+}
+
+
+package main;
+
+my $Request = shift;
+my $Page = RoleDetailsPage->new($Request, "admin");
+$Page->GeneratePage();
diff --git a/testbot/web/admin/RolesList.pl b/testbot/web/admin/RolesList.pl
new file mode 100644
index 0000000..3fb765b
--- /dev/null
+++ b/testbot/web/admin/RolesList.pl
@@ -0,0 +1,30 @@
+# -*- Mode: Perl; perl-indent-level: 2; indent-tabs-mode: nil -*-
+# Role list page
+#
+# Copyright 2009 Ge van Geldorp
+# Copyright 2022 Francois Gouget
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+use strict;
+
+package main;
+
+use ObjectModel::CGI::CollectionPage;
+use WineTestBot::Roles;
+
+my $Request = shift;
+my $Page = ObjectModel::CGI::CollectionPage->new($Request, "admin", CreateRoles());
+$Page->GeneratePage();




More information about the wine-cvs mailing list