mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
monitoring/security: Hide 'Remove Problem Acknowledgement' action if user lacks the respective permission
This commit is contained in:
parent
a09ba15859
commit
f46a587266
@ -22,7 +22,13 @@ if ($object->getType() === $object::TYPE_HOST) {
|
|||||||
if ($object->acknowledged): ?>
|
if ($object->acknowledged): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->translate('Acknowledged') ?></th>
|
<th><?= $this->translate('Acknowledged') ?></th>
|
||||||
<td><?= $removeAckForm ?></td>
|
<td>
|
||||||
|
<?php if (isset($removeAckForm)) { // Form is unset if the current user lacks the respective permission
|
||||||
|
echo $removeAckForm;
|
||||||
|
} else {
|
||||||
|
echo '-';
|
||||||
|
} ?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -67,11 +67,13 @@ abstract class MonitoredObjectController extends Controller
|
|||||||
}
|
}
|
||||||
if ( ! in_array((int) $this->object->state, array(0, 99))) {
|
if ( ! in_array((int) $this->object->state, array(0, 99))) {
|
||||||
if ((bool) $this->object->acknowledged) {
|
if ((bool) $this->object->acknowledged) {
|
||||||
$removeAckForm = new RemoveAcknowledgementCommandForm();
|
if ($auth->hasPermission('monitoring/command/remove-acknowledgement')) {
|
||||||
$removeAckForm
|
$removeAckForm = new RemoveAcknowledgementCommandForm();
|
||||||
->setObjects($this->object)
|
$removeAckForm
|
||||||
->handleRequest();
|
->setObjects($this->object)
|
||||||
$this->view->removeAckForm = $removeAckForm;
|
->handleRequest();
|
||||||
|
$this->view->removeAckForm = $removeAckForm;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$ackForm = new AcknowledgeProblemCommandForm();
|
$ackForm = new AcknowledgeProblemCommandForm();
|
||||||
$ackForm
|
$ackForm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user