Security: Add permissions as tab to config

refs #5647
This commit is contained in:
Eric Lippmann 2014-11-19 15:32:25 +01:00
parent 1db85a745a
commit bfdf34b6bf
3 changed files with 28 additions and 3 deletions

View File

@ -24,14 +24,17 @@ class ConfigController extends ActionController
public function init() public function init()
{ {
$this->view->tabs = Widget::create('tabs')->add('index', array( $this->view->tabs = Widget::create('tabs')->add('index', array(
'title' => 'Application', 'title' => $this->translate('Application'),
'url' => 'config' 'url' => 'config'
))->add('authentication', array( ))->add('authentication', array(
'title' => 'Authentication', 'title' => $this->translate('Authentication'),
'url' => 'config/authentication' 'url' => 'config/authentication'
))->add('resources', array( ))->add('resources', array(
'title' => 'Resources', 'title' => $this->translate('Resources'),
'url' => 'config/resource' 'url' => 'config/resource'
))->add('permissions', array(
'title' => $this->translate('Permissions'),
'url' => 'permissions'
)); ));
} }

View File

@ -7,11 +7,30 @@ use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Forms\Security\RoleForm; use Icinga\Forms\Security\RoleForm;
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller\ActionController;
use Icinga\Web\Notification; use Icinga\Web\Notification;
use Icinga\Web\Widget;
class PermissionsController extends ActionController class PermissionsController extends ActionController
{ {
public function init()
{
$this->view->tabs = Widget::create('tabs')->add('index', array(
'title' => $this->translate('Application'),
'url' => 'config'
))->add('authentication', array(
'title' => $this->translate('Authentication'),
'url' => 'config/authentication'
))->add('resources', array(
'title' => $this->translate('Resources'),
'url' => 'config/resource'
))->add('permissions', array(
'title' => $this->translate('Permissions'),
'url' => 'permissions'
));
}
public function indexAction() public function indexAction()
{ {
$this->view->tabs->activate('permissions');
$this->view->roles = Config::app('roles', true); $this->view->roles = Config::app('roles', true);
} }

View File

@ -1,3 +1,6 @@
<div class="controls">
<?= $tabs ?>
</div>
<div class="content"> <div class="content">
<div> <div>
<h1><?= $this->translate('Permissions') ?></h1> <h1><?= $this->translate('Permissions') ?></h1>