mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
GroupController: Apply permission config/application/groups/add
refs #8826
This commit is contained in:
parent
e31c99be1c
commit
fd2ecf395d
@ -165,6 +165,7 @@ class GroupController extends AuthBackendController
|
|||||||
*/
|
*/
|
||||||
public function addAction()
|
public function addAction()
|
||||||
{
|
{
|
||||||
|
$this->assertPermission('config/application/groups/add');
|
||||||
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible');
|
$backend = $this->getUserGroupBackend($this->params->getRequired('backend'), 'Icinga\Data\Extensible');
|
||||||
$form = new UserGroupForm();
|
$form = new UserGroupForm();
|
||||||
$form->setRedirectUrl(Url::fromPath('group/list', array('backend' => $backend->getName())));
|
$form->setRedirectUrl(Url::fromPath('group/list', array('backend' => $backend->getName())));
|
||||||
|
@ -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 {
|
||||||
$extensible = $backend instanceof Extensible;
|
|
||||||
$reducible = $backend instanceof Reducible;
|
$reducible = $backend instanceof Reducible;
|
||||||
|
$extensible = $this->hasPermission('config/application/groups/add') && $backend instanceof Extensible;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($groups) > 0): ?>
|
if (count($groups) > 0): ?>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use Icinga\Data\Extensible;
|
use Icinga\Data\Extensible;
|
||||||
use Icinga\Data\Updatable;
|
use Icinga\Data\Updatable;
|
||||||
|
|
||||||
$extensible = $backend instanceof Extensible;
|
$extensible = $this->hasPermission('config/application/groups/add') && $backend instanceof Extensible;
|
||||||
|
|
||||||
$editLink = null;
|
$editLink = null;
|
||||||
if ($backend instanceof Updatable) {
|
if ($backend instanceof Updatable) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user