GroupController: Apply permission config/application/groups/add

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-27 10:32:09 +02:00
parent e31c99be1c
commit fd2ecf395d
3 changed files with 3 additions and 2 deletions

View File

@ -165,6 +165,7 @@ class GroupController extends AuthBackendController
*/
public function addAction()
{
$this->assertPermission('config/application/groups/add');
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible');
$form = new UserGroupForm();
$form->setRedirectUrl(Url::fromPath('group/list', array('backend' => $backend->getName())));

View File

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

View File

@ -3,7 +3,7 @@
use Icinga\Data\Extensible;
use Icinga\Data\Updatable;
$extensible = $backend instanceof Extensible;
$extensible = $this->hasPermission('config/application/groups/add') && $backend instanceof Extensible;
$editLink = null;
if ($backend instanceof Updatable) {