2015-01-28 14:15:16 +01:00
|
|
|
<div class="controls" data-base-target="_main">
|
2014-11-25 15:18:49 +01:00
|
|
|
<?= $tabs ?>
|
2014-11-25 16:16:31 +01:00
|
|
|
<h1><?= $this->translate('Roles') ?></h1>
|
2014-11-25 15:18:49 +01:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div>
|
|
|
|
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
|
2014-11-25 16:10:00 +01:00
|
|
|
<?= $this->translate('No roles found.') ?>
|
2014-11-25 15:18:49 +01:00
|
|
|
<?php else: ?>
|
|
|
|
<table class="avp action" data-base-target="_next">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Name') ?></th>
|
2015-02-03 15:10:18 +01:00
|
|
|
<!-- <th>--><?//= $this->translate('Permissions') ?><!--</th>-->
|
|
|
|
<!-- <th>--><?//= $this->translate('Restrictions') ?><!--</th>-->
|
2014-11-25 15:18:49 +01:00
|
|
|
<th><?= $this->translate('Users') ?></th>
|
|
|
|
<th><?= $this->translate('Groups') ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($roles as $name => $role): /** @var object $role */ ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<?= $this->escape($name) ?>
|
|
|
|
<div class="hidden">
|
2014-11-25 16:10:00 +01:00
|
|
|
<a href="<?= $this->url('roles/update', array('role' => $name)) ?>"></a>
|
2014-11-25 15:18:49 +01:00
|
|
|
</div>
|
|
|
|
</td>
|
2015-02-03 15:10:18 +01:00
|
|
|
<!-- <td>--><?//= $this->escape($role->permissions, 0, 50) ?><!--</td>-->
|
|
|
|
<!-- <td>-->
|
|
|
|
<!-- --><?php
|
|
|
|
// // TODO(el): $role->without(...) or $role->shift(...) would be nice!
|
|
|
|
// $restrictions = clone $role;
|
|
|
|
// unset($restrictions['users']);
|
|
|
|
// unset($restrictions['groups']);
|
|
|
|
// unset($restrictions['permissions']);
|
|
|
|
// ?>
|
|
|
|
<!-- --><?php //if (! empty($restrictions)): ?>
|
|
|
|
<!-- <table>-->
|
|
|
|
<!-- <tbody>-->
|
|
|
|
<!-- --><?php //foreach ($restrictions as $restrictionName => $restriction): ?>
|
|
|
|
<!-- <tr>-->
|
|
|
|
<!-- <th>--><?//= $this->escape($restrictionName) ?><!--</th>-->
|
|
|
|
<!-- <td>--><?//= $this->escape($restriction) ?><!--</td>-->
|
|
|
|
<!-- </tr>-->
|
|
|
|
<!-- --><?php //endforeach ?>
|
|
|
|
<!-- </tbody>-->
|
|
|
|
<!-- </table>-->
|
|
|
|
<!-- --><?php //endif ?>
|
|
|
|
<!-- </td>-->
|
2014-11-25 15:18:49 +01:00
|
|
|
<td><?= $this->escape($role->users) ?></td>
|
|
|
|
<td><?= $this->escape($role->groups) ?></td>
|
|
|
|
<td>
|
2015-02-16 11:02:09 +01:00
|
|
|
<?= $this->qlink(
|
|
|
|
$this->icon('cancel'),
|
|
|
|
'roles/remove',
|
|
|
|
array('role' => $name),
|
|
|
|
array('title' => sprintf($this->translate('Remove role %s'), $name)),
|
|
|
|
false
|
|
|
|
); ?>
|
2014-11-25 15:18:49 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php endif ?>
|
2014-11-25 16:10:00 +01:00
|
|
|
<a data-base-target="_next" href="<?= $this->href('roles/new') ?>">
|
2014-11-25 15:18:49 +01:00
|
|
|
<?= $this->translate('New Role') ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|