mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
GroupController: Apply permission config/application/groups/show
refs #8826
This commit is contained in:
parent
0e37aad6ce
commit
e31c99be1c
@ -29,6 +29,7 @@ class GroupController extends AuthBackendController
|
|||||||
*/
|
*/
|
||||||
public function listAction()
|
public function listAction()
|
||||||
{
|
{
|
||||||
|
$this->assertPermission('config/application/groups/show');
|
||||||
$backendNames = array_map(
|
$backendNames = array_map(
|
||||||
function ($b) { return $b->getName(); },
|
function ($b) { return $b->getName(); },
|
||||||
$this->loadUserGroupBackends('Icinga\Data\Selectable')
|
$this->loadUserGroupBackends('Icinga\Data\Selectable')
|
||||||
@ -86,6 +87,7 @@ class GroupController extends AuthBackendController
|
|||||||
*/
|
*/
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
|
$this->assertPermission('config/application/groups/show');
|
||||||
$groupName = $this->params->getRequired('group');
|
$groupName = $this->params->getRequired('group');
|
||||||
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'));
|
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'));
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Icinga\Data\Updatable;
|
use Icinga\Data\Updatable;
|
||||||
use Icinga\Data\Reducible;
|
use Icinga\Data\Reducible;
|
||||||
|
use Icinga\Data\Selectable;
|
||||||
|
|
||||||
$editLink = null;
|
$editLink = null;
|
||||||
if ($this->hasPermission('config/application/users/edit') && $backend instanceof Updatable) {
|
if ($this->hasPermission('config/application/users/edit') && $backend instanceof Updatable) {
|
||||||
@ -52,12 +53,18 @@ if ($this->hasPermission('config/application/users/edit') && $backend instanceof
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($memberships as $membership): ?>
|
<?php foreach ($memberships as $membership): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="membership-group"><?= $this->qlink($membership->group_name, 'group/show', array(
|
<td class="membership-group">
|
||||||
|
<?php if ($this->hasPermission('config/application/groups/show') && $membership->backend instanceof Selectable): ?>
|
||||||
|
<?= $this->qlink($membership->group_name, 'group/show', array(
|
||||||
'backend' => $membership->backend->getName(),
|
'backend' => $membership->backend->getName(),
|
||||||
'group' => $membership->group_name
|
'group' => $membership->group_name
|
||||||
), array(
|
), array(
|
||||||
'title' => sprintf($this->translate('Show detailed information for group %s'), $membership->group_name)
|
'title' => sprintf($this->translate('Show detailed information for group %s'), $membership->group_name)
|
||||||
)); ?></td>
|
)); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= $this->escape($membership->group_name); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
</td>
|
||||||
<td class="membership-cancel" data-base-target="_self">
|
<td class="membership-cancel" data-base-target="_self">
|
||||||
<?php if ($membership->backend instanceof Reducible): ?>
|
<?php if ($membership->backend instanceof Reducible): ?>
|
||||||
<?= $removeForm->setAction($this->url('group/removemember', array(
|
<?= $removeForm->setAction($this->url('group/removemember', array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user