monitoring/security: Hide delete downtime action in the downtimes overview if user lacks the respective permission
This commit is contained in:
parent
5967d5fe04
commit
ac5ac10feb
|
@ -306,7 +306,10 @@ class Monitoring_ListController extends Controller
|
|||
));
|
||||
|
||||
$this->view->downtimes = $query->paginate();
|
||||
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
|
||||
|
||||
if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) {
|
||||
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -114,6 +114,7 @@ use Icinga\Module\Monitoring\Object\Service;
|
|||
<?php endif ?>
|
||||
</small>
|
||||
</td>
|
||||
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||
<td style="width: 2em" data-base-target="self">
|
||||
<?php
|
||||
$delDowntimeForm = clone $delDowntimeForm;
|
||||
|
@ -126,6 +127,7 @@ use Icinga\Module\Monitoring\Object\Service;
|
|||
echo $delDowntimeForm;
|
||||
?>
|
||||
</td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue