mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +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): ?>
|
||||
<tr>
|
||||
<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>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
|
@ -67,11 +67,13 @@ abstract class MonitoredObjectController extends Controller
|
||||
}
|
||||
if ( ! in_array((int) $this->object->state, array(0, 99))) {
|
||||
if ((bool) $this->object->acknowledged) {
|
||||
$removeAckForm = new RemoveAcknowledgementCommandForm();
|
||||
$removeAckForm
|
||||
->setObjects($this->object)
|
||||
->handleRequest();
|
||||
$this->view->removeAckForm = $removeAckForm;
|
||||
if ($auth->hasPermission('monitoring/command/remove-acknowledgement')) {
|
||||
$removeAckForm = new RemoveAcknowledgementCommandForm();
|
||||
$removeAckForm
|
||||
->setObjects($this->object)
|
||||
->handleRequest();
|
||||
$this->view->removeAckForm = $removeAckForm;
|
||||
}
|
||||
} else {
|
||||
$ackForm = new AcknowledgeProblemCommandForm();
|
||||
$ackForm
|
||||
|
Loading…
x
Reference in New Issue
Block a user