getRequest()->getParam('tunnel_id', '')); $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON); if ($tunnelId !== '') { $resultJson->setData($this->tunnelStatus->getStatus($tunnelId)); return $resultJson; } $resultJson->setData([ 'tunnels' => $this->tunnelStatus->getAllTunnelStatuses(), ]); return $resultJson; } protected function _isAllowed() { return $this->_authorization->isAllowed('MageSail_Magesail::tunnel'); } }