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;
|
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): ?>
|
if ($object->acknowledged): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->translate('Acknowledged') ?></th>
|
<th><?= $this->translate('Acknowledged') ?></th>
|
||||||
|
@ -34,12 +22,25 @@ if ($object->acknowledged): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->translate('Not acknowledged') ?></th>
|
<th><?= $this->translate('Not acknowledged') ?></th>
|
||||||
<td>
|
<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 ?>">
|
<a href="<?= $ackLink ?>">
|
||||||
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?>
|
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?>
|
||||||
</a>
|
</a>
|
||||||
|
<?php } else {
|
||||||
|
echo '-';
|
||||||
|
} // endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
</a>
|
</a>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
echo '-';
|
echo '-';
|
||||||
} ?>
|
} // endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
</a>
|
</a>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
echo '-';
|
echo '-';
|
||||||
} ?>
|
} // endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue