diff --git a/application/controllers/EndpointController.php b/application/controllers/EndpointController.php index 23308348..93be5156 100644 --- a/application/controllers/EndpointController.php +++ b/application/controllers/EndpointController.php @@ -9,7 +9,7 @@ class EndpointController extends ObjectController public function init() { parent::init(); - if ($this->isPeer()) { + if ($this->object && $this->object->hasApiUser()) { $params['endpoint'] = $this->object->object_name; $this->getTabs()->add('inspect', array( @@ -19,19 +19,4 @@ class EndpointController extends ObjectController )); } } - - protected function isPeer() - { - if (! $this->object) return false; - - $apiconfig = $this->Config()->getSection('api'); - $host = $apiconfig->get('address'); - $port = $apiconfig->get('port'); - - if ($host === $this->object->host - && $port === $this->object->port - ) { - return true; - } - } }