Security: Show roles instead of permissions and restrictions
refs #5647
This commit is contained in:
parent
a2818bd937
commit
8aab5dc0f0
|
@ -1,8 +1,8 @@
|
|||
<div class="content">
|
||||
<div>
|
||||
<h1><?= $this->translate('Permissions') ?></h1>
|
||||
<?php /** @var \Icinga\Application\Config $permissions */ if ($permissions->isEmpty()): ?>
|
||||
<?= $this->translate('No permissions found.') ?>
|
||||
<h1><?= $this->translate('Roles') ?></h1>
|
||||
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
|
||||
<?= $this->translate('No roles found.') ?>
|
||||
<?php else: ?>
|
||||
<table class="action" data-base-target="_next">
|
||||
<thead>
|
||||
|
@ -14,20 +14,20 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($permissions as $name => $permission): /** @var object $permission */ ?>
|
||||
<?php foreach ($roles as $name => $role): /** @var object $role */ ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $this->escape($name) ?>
|
||||
<div class="hidden">
|
||||
<a href="<?= $this->url('security/update-permission', array('permission' => $name)) ?>"></a>
|
||||
<a href="<?= $this->url('security/update-role', array('role' => $name)) ?>"></a>
|
||||
</div>
|
||||
</td>
|
||||
<td><?= $this->escape($permission->permissions) ?></td>
|
||||
<td><?= $this->escape($permission->users) ?></td>
|
||||
<td><?= $this->escape($permission->groups) ?></td>
|
||||
<td><?= $this->escape($role->permissions) ?></td>
|
||||
<td><?= $this->escape($role->users) ?></td>
|
||||
<td><?= $this->escape($role->groups) ?></td>
|
||||
<td>
|
||||
<a href="<?= $this->url('security/remove-permission', array('permission' => $name)) ?>">
|
||||
<?= $this->translate('Remove permission') ?>
|
||||
<a href="<?= $this->url('security/remove-role', array('role' => $name)) ?>">
|
||||
<?= $this->translate('Remove role') ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -35,50 +35,8 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
<a data-base-target="_next" href="<?= $this->href('security/new-permission') ?>">
|
||||
<?= $this->translate('Grant Permissions') ?>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<h1><?= $this->translate('Restrictions') ?></h1>
|
||||
<?php /** @var \Icinga\Application\Config $restrictions */ if ($restrictions->isEmpty()): ?>
|
||||
<?= $this->translate('No restrictions found.') ?>
|
||||
<?php else: ?>
|
||||
<table class="action" data-base-target="_next">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->translate('Name') ?></th>
|
||||
<th><?= $this->translate('Restriction Name') ?></th>
|
||||
<th><?= $this->translate('Restriction') ?></th>
|
||||
<th><?= $this->translate('Users') ?></th>
|
||||
<th><?= $this->translate('Groups') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($restrictions as $name => $restriction): /** @var object $restriction */ ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $this->escape($name) ?>
|
||||
<div class="hidden" data-base-target="_next">
|
||||
<a href="<?= $this->url('security/update-restriction', array('restriction' => $name)) ?>"></a>
|
||||
</div>
|
||||
</td>
|
||||
<td><?= $this->escape($restriction->name) ?></td>
|
||||
<td><?= $this->escape($restriction->restriction) ?></td>
|
||||
<td><?= $this->escape($restriction->users) ?></td>
|
||||
<td><?= $this->escape($restriction->groups) ?></td>
|
||||
<td>
|
||||
<a href="<?= $this->url('security/remove-restriction', array('restriction' => $name)) ?>">
|
||||
<?= $this->translate('Remove restriction') ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
<a class="btn" data-base-target="_next" href="<?= $this->href('security/new-restriction') ?>">
|
||||
<?= $this->translate('Set Restriction') ?>
|
||||
<a data-base-target="_next" href="<?= $this->href('security/new-role') ?>">
|
||||
<?= $this->translate('New Role') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue