monitoring/security: Hide 'Process check result' link if user lacks the respective permission
This commit is contained in:
parent
2535d802b1
commit
08e8d5d742
|
@ -3,25 +3,32 @@
|
|||
$parts = explode('!', $object->check_command);
|
||||
$command = array_shift($parts);
|
||||
|
||||
?><tr class="newsection">
|
||||
<th><?= $this->translate('Command') ?></th>
|
||||
<td>
|
||||
<?= $this->escape($command) ?>
|
||||
<?php if ($object->passive_checks_enabled): ?>
|
||||
<?php if ($object->getType() === $object::TYPE_HOST): ?>
|
||||
<a href="<?= $this->href(
|
||||
'monitoring/host/process-check-result',
|
||||
array('host' => $object->getName())
|
||||
); ?>"><?= $this->icon('reply'); ?> <?= $this->translate('Process check result'); ?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?= $this->href(
|
||||
'monitoring/service/process-check-result',
|
||||
array('host' => $object->getHost()->getName(), 'service' => $object->getName())
|
||||
); ?>"><?= $this->icon('reply'); ?> <?= $this->translate('Process check result'); ?></a>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
?>
|
||||
|
||||
<tr class="newsection">
|
||||
<th><?= $this->translate('Command') ?></th>
|
||||
<td>
|
||||
<?= $this->escape($command) ?>
|
||||
<?php if ($this->hasPermission('monitoring/command/schedule-check') && $object->passive_checks_enabled): ?>
|
||||
<?php if ($object->getType() === $object::TYPE_HOST) {
|
||||
$processCheckResult = $this->href(
|
||||
'monitoring/host/process-check-result',
|
||||
array('host' => $object->getName())
|
||||
);
|
||||
} else {
|
||||
$processCheckResult = $this->href(
|
||||
'monitoring/service/process-check-result',
|
||||
array('host' => $object->getHost()->getName(), 'service' => $object->getName())
|
||||
);
|
||||
} ?>
|
||||
<a href="<?= $processCheckResult ?>">
|
||||
<?= $this->icon('reply') ?>
|
||||
<?= $this->translate('Process check result') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$row = "<tr>\n <th>%s</th>\n <td>%s</td>\n</tr>\n";
|
||||
|
|
Loading…
Reference in New Issue