GroupController: Apply permission config/application/groups/remove

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-27 10:33:20 +02:00
parent b58cd4747c
commit 0c9bac0686
2 changed files with 3 additions and 2 deletions

View File

@ -130,7 +130,7 @@ class GroupController extends AuthBackendController
$this->view->members = $members; $this->view->members = $members;
$this->createShowTabs($backend->getName(), $groupName)->activate('group/show'); $this->createShowTabs($backend->getName(), $groupName)->activate('group/show');
if ($backend instanceof Reducible) { if ($this->hasPermission('config/application/groups/remove') && $backend instanceof Reducible) {
$removeForm = new Form(); $removeForm = new Form();
$removeForm->setUidDisabled(); $removeForm->setUidDisabled();
$removeForm->setAction( $removeForm->setAction(
@ -206,6 +206,7 @@ class GroupController extends AuthBackendController
*/ */
public function removeAction() public function removeAction()
{ {
$this->assertPermission('config/application/groups/remove');
$groupName = $this->params->getRequired('group'); $groupName = $this->params->getRequired('group');
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Reducible'); $backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Reducible');

View File

@ -22,8 +22,8 @@ if ($backend === null) {
echo $this->translate('No backend found which is able to list groups') . '</div>'; echo $this->translate('No backend found which is able to list groups') . '</div>';
return; return;
} else { } else {
$reducible = $backend instanceof Reducible;
$extensible = $this->hasPermission('config/application/groups/add') && $backend instanceof Extensible; $extensible = $this->hasPermission('config/application/groups/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/application/groups/remove') && $backend instanceof Reducible;
} }
if (count($groups) > 0): ?> if (count($groups) > 0): ?>