Signed-off-by: Francois Gouget fgouget@codeweavers.com --- I don't forsee a need to add / remove roles but it is useful to at least be able to see which ones exist. In that it's similar to the Branches pages and fills a hole in the website administration interface. These pages are also little more than a 's/Branch/Role/g' of the Branches pages and should not require much maintenance. --- v1 failed to apply because the context had a bit from a patch in my worktree adding a copy of the "Special Jobs" page (I guess that patch should not be part of my "configuration tweaks for my copy of the TestBot" patches). --- testbot/lib/WineTestBot/CGI/PageBase.pm | 2 ++ testbot/web/admin/RoleDetails.pl | 42 +++++++++++++++++++++++++ testbot/web/admin/RolesList.pl | 30 ++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 testbot/web/admin/RoleDetails.pl create mode 100644 testbot/web/admin/RolesList.pl
diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm index c42a4f2b4..40f519737 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 000000000..3f6d02eb8 --- /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 000000000..3fb765b0a --- /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();