Skip to content

Commit

Permalink
GroupController: Apply permission config/application/groups/member/add
Browse files Browse the repository at this point in the history
refs #8826
  • Loading branch information
Johannes Meyer committed May 27, 2015
1 parent 0c9bac0 commit 1517c72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions application/controllers/GroupController.php
Expand Up @@ -228,6 +228,7 @@ public function removeAction()
*/
public function addmemberAction()
{
$this->assertPermission('config/application/groups/member/add');
$groupName = $this->params->getRequired('group');
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible');

Expand Down
9 changes: 7 additions & 2 deletions application/controllers/UserController.php
Expand Up @@ -120,8 +120,12 @@ public function showAction()
$memberships
);

$extensibleBackends = $this->loadUserGroupBackends('Icinga\Data\Extensible');
$this->view->showCreateMembershipLink = ! empty($extensibleBackends);
if ($this->hasPermission('config/application/groups/member/add')) {
$extensibleBackends = $this->loadUserGroupBackends('Icinga\Data\Extensible');
$this->view->showCreateMembershipLink = ! empty($extensibleBackends);
} else {
$this->view->showCreateMembershipLink = false;
}

$this->view->user = $user;
$this->view->backend = $backend;
Expand Down Expand Up @@ -220,6 +224,7 @@ public function removeAction()
*/
public function createmembershipAction()
{
$this->assertPermission('config/application/groups/member/add');
$userName = $this->params->getRequired('user');
$backend = $this->getUserBackend($this->params->getRequired('backend'));

Expand Down

0 comments on commit 1517c72

Please sign in to comment.