mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-13 17:04:24 +02:00
Only show edit role link if user has the appropriate permission
This commit is contained in:
parent
57b64f85bf
commit
564fb8c320
@ -170,6 +170,7 @@ class UserController extends AuthBackendController
|
|||||||
$admissionLoader = new AdmissionLoader();
|
$admissionLoader = new AdmissionLoader();
|
||||||
$admissionLoader->applyRoles($userObj);
|
$admissionLoader->applyRoles($userObj);
|
||||||
$this->view->userObj = $userObj;
|
$this->view->userObj = $userObj;
|
||||||
|
$this->view->allowedToEditRoles = $this->hasPermission('config/authentication/roles/edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,12 +47,17 @@ use Icinga\Data\Selectable;
|
|||||||
<?php if (! empty($roleObj)): ?>
|
<?php if (! empty($roleObj)): ?>
|
||||||
<ul class="role-memberships">
|
<ul class="role-memberships">
|
||||||
<?php foreach($roleObj as $role): ?>
|
<?php foreach($roleObj as $role): ?>
|
||||||
<li><?= $this->qlink(
|
<li>
|
||||||
|
<?php if ($this->allowedToEditRoles): ?>
|
||||||
|
<?= $this->qlink(
|
||||||
$role->getName(),
|
$role->getName(),
|
||||||
'role/edit',
|
'role/edit',
|
||||||
['role' => $role->getName()],
|
['role' => $role->getName()],
|
||||||
['title' => sprintf($this->translate('Edit role %s'), $role->getName())]
|
['title' => sprintf($this->translate('Edit role %s'), $role->getName())]
|
||||||
) ?>
|
) ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= $role->getName() ?>
|
||||||
|
<?php endif ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user