monitoring/security: Hide 'Acknowledge' link if user lacks the respective permission
This commit is contained in:
parent
08e8d5d742
commit
3cb2dd0e8b
|
@ -7,18 +7,6 @@ if (in_array((int) $object->state, array(0, 99))) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($object->getType() === $object::TYPE_HOST) {
|
||||
$ackLink = $this->href(
|
||||
'monitoring/host/acknowledge-problem',
|
||||
array('host' => $object->getName())
|
||||
);
|
||||
} else {
|
||||
$ackLink = $this->href(
|
||||
'monitoring/service/acknowledge-problem',
|
||||
array('host' => $object->getHost()->getName(), 'service' => $object->getName())
|
||||
);
|
||||
}
|
||||
|
||||
if ($object->acknowledged): ?>
|
||||
<tr>
|
||||
<th><?= $this->translate('Acknowledged') ?></th>
|
||||
|
@ -34,12 +22,25 @@ if ($object->acknowledged): ?>
|
|||
<tr>
|
||||
<th><?= $this->translate('Not acknowledged') ?></th>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
<?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) {
|
||||
if ($object->getType() === $object::TYPE_HOST) {
|
||||
$ackLink = $this->href(
|
||||
'monitoring/host/acknowledge-problem',
|
||||
array('host' => $object->getName())
|
||||
);
|
||||
} else {
|
||||
$ackLink = $this->href(
|
||||
'monitoring/service/acknowledge-problem',
|
||||
array('host' => $object->getHost()->getName(), 'service' => $object->getName())
|
||||
);
|
||||
}
|
||||
?>
|
||||
<a href="<?= $ackLink ?>">
|
||||
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?>
|
||||
</a>
|
||||
<?php } else {
|
||||
echo '-';
|
||||
} // endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</a>
|
||||
<?php } else {
|
||||
echo '-';
|
||||
} ?>
|
||||
} // endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</a>
|
||||
<?php } else {
|
||||
echo '-';
|
||||
} ?>
|
||||
} // endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
Loading…
Reference in New Issue