MonitoredObjectController: Don't show `Check Now` if active checks are disabled

refs #3665
This commit is contained in:
Johannes Meyer 2019-02-01 13:03:40 +01:00
parent b275a1383d
commit 3d4fa0bcae
1 changed files with 5 additions and 1 deletions

View File

@ -268,7 +268,11 @@ abstract class MonitoredObjectController extends Controller
protected function setupQuickActionForms() protected function setupQuickActionForms()
{ {
$auth = $this->Auth(); $auth = $this->Auth();
if ($auth->hasPermission('monitoring/command/schedule-check')) { if ($auth->hasPermission('monitoring/command/schedule-check')
|| ($auth->hasPermission('monitoring/command/schedule-check/active-only')
&& $this->object->active_checks_enabled
)
) {
$this->view->checkNowForm = $checkNowForm = new CheckNowCommandForm(); $this->view->checkNowForm = $checkNowForm = new CheckNowCommandForm();
$checkNowForm $checkNowForm
->setObjects($this->object) ->setObjects($this->object)