From 4e6528e8626d183f125bf6318ce4e7024192ebe3 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Mon, 20 Nov 2023 15:57:14 +0100 Subject: [PATCH] ServiceController: Remove redudant if condition --- application/controllers/ServiceController.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index c09b0937..90f6ae50 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -29,12 +29,11 @@ class ServiceController extends ObjectController protected function checkDirectorPermissions() { - if ($this->hasPermission(Permission::MONITORING_SERVICES)) { - if ($this->backend()->canModifyService($this->getParam('host'), $this->getParam('name'))) { - return; - } + if ($this->backend()->canModifyService($this->getParam('host'), $this->getParam('name'))) { + return; } - $this->assertPermission('director/hosts'); + + $this->assertPermission(Permission::HOSTS); } public function init()