Security: Require permissions for executing common host commands

This commit is contained in:
Eric Lippmann 2015-01-22 15:22:20 +01:00
parent 9b7e75a616
commit 44718e5012
1 changed files with 10 additions and 0 deletions

View File

@ -47,6 +47,8 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function acknowledgeProblemAction() public function acknowledgeProblemAction()
{ {
$this->assertPermission('monitoring/command/acknowledge-problem');
$this->view->title = $this->translate('Acknowledge Host Problem'); $this->view->title = $this->translate('Acknowledge Host Problem');
$this->handleCommandForm(new AcknowledgeProblemCommandForm()); $this->handleCommandForm(new AcknowledgeProblemCommandForm());
} }
@ -56,6 +58,8 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function addCommentAction() public function addCommentAction()
{ {
$this->assertPermission('monitoring/command/add-comment');
$this->view->title = $this->translate('Add Host Comment'); $this->view->title = $this->translate('Add Host Comment');
$this->handleCommandForm(new AddCommentCommandForm()); $this->handleCommandForm(new AddCommentCommandForm());
} }
@ -65,6 +69,8 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function rescheduleCheckAction() public function rescheduleCheckAction()
{ {
$this->assertPermission('monitoring/command/schedule-check');
$this->view->title = $this->translate('Reschedule Host Check'); $this->view->title = $this->translate('Reschedule Host Check');
$this->handleCommandForm(new ScheduleHostCheckCommandForm()); $this->handleCommandForm(new ScheduleHostCheckCommandForm());
} }
@ -74,6 +80,8 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function scheduleDowntimeAction() public function scheduleDowntimeAction()
{ {
$this->assertPermission('monitoring/command/schedule-downtime');
$this->view->title = $this->translate('Schedule Host Downtime'); $this->view->title = $this->translate('Schedule Host Downtime');
$this->handleCommandForm(new ScheduleHostDowntimeCommandForm()); $this->handleCommandForm(new ScheduleHostDowntimeCommandForm());
} }
@ -83,6 +91,8 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function processCheckResultAction() public function processCheckResultAction()
{ {
$this->assertPermission('monitoring/command/process-check-result');
$this->view->title = $this->translate('Submit Passive Host Check Result'); $this->view->title = $this->translate('Submit Passive Host Check Result');
$this->handleCommandForm(new ProcessCheckResultCommandForm()); $this->handleCommandForm(new ProcessCheckResultCommandForm());
} }