mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
monitoring/security: Hide 'Check Now' action if user lacks the respective permission
This commit is contained in:
parent
44de790cc9
commit
a09ba15859
@ -23,7 +23,9 @@ if ($object->getType() === $object::TYPE_HOST) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->translate('Last check') ?></th>
|
<th><?= $this->translate('Last check') ?></th>
|
||||||
<td data-base-target="_self">
|
<td data-base-target="_self">
|
||||||
<?= $checkNowForm ?>
|
<?php if (isset($checkNowForm)) { // Form is unset if the current user lacks the respective permission
|
||||||
|
echo $checkNowForm;
|
||||||
|
} ?>
|
||||||
<?= $this->timeSince($object->last_check) ?>
|
<?= $this->timeSince($object->last_check) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -57,11 +57,14 @@ abstract class MonitoredObjectController extends Controller
|
|||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$this->setAutorefreshInterval(10);
|
$this->setAutorefreshInterval(10);
|
||||||
$checkNowForm = new CheckNowCommandForm();
|
$auth = $this->Auth();
|
||||||
$checkNowForm
|
if ($auth->hasPermission('monitoring/command/schedule-check')) {
|
||||||
->setObjects($this->object)
|
$checkNowForm = new CheckNowCommandForm();
|
||||||
->handleRequest();
|
$checkNowForm
|
||||||
$this->view->checkNowForm = $checkNowForm;
|
->setObjects($this->object)
|
||||||
|
->handleRequest();
|
||||||
|
$this->view->checkNowForm = $checkNowForm;
|
||||||
|
}
|
||||||
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();
|
$removeAckForm = new RemoveAcknowledgementCommandForm();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user