From 63514eeeb780db2afa2058a4cdb96532f5d07446 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 10 Mar 2020 09:58:49 +0100 Subject: [PATCH] Add controls to the roles list --- application/controllers/RoleController.php | 16 ++++++++++++++-- application/views/scripts/role/list.phtml | 10 ++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/application/controllers/RoleController.php b/application/controllers/RoleController.php index 246d8900b..a65510471 100644 --- a/application/controllers/RoleController.php +++ b/application/controllers/RoleController.php @@ -3,7 +3,6 @@ namespace Icinga\Controllers; -use Icinga\Application\Config; use Icinga\Authentication\RolesConfig; use Icinga\Exception\NotFoundError; use Icinga\Forms\Security\RoleForm; @@ -32,7 +31,20 @@ class RoleController extends AuthBackendController { $this->assertPermission('config/authentication/roles/show'); $this->createListTabs()->activate('role/list'); - $this->view->roles = Config::app('roles', true); + $this->view->roles = (new RolesConfig()) + ->select(); + + $sortAndFilterColumns = [ + 'name' => $this->translate('Name'), + 'users' => $this->translate('Users'), + 'groups' => $this->translate('Groups'), + 'permissions' => $this->translate('Permissions') + ]; + + $this->setupFilterControl($this->view->roles, $sortAndFilterColumns, ['name']); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->roles); + $this->setupSortControl($sortAndFilterColumns, $this->view->roles, ['name']); } /** diff --git a/application/views/scripts/role/list.phtml b/application/views/scripts/role/list.phtml index 9d047b4d7..9045d0e3b 100644 --- a/application/views/scripts/role/list.phtml +++ b/application/views/scripts/role/list.phtml @@ -1,5 +1,11 @@ -
+
+ paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?>
qlink( @@ -13,7 +19,7 @@ 'title' => $this->translate('Create a new role') ) ) ?> -isEmpty()): ?> +hasResult()): ?>

translate('No roles found.') ?>