public function supplServicesAction() { $data = $this->_checkAndGetListData(null, true); if (empty($data['services']) || !is_array($data['services'])) { throw new AppEx\InvalidArgumentException('Bad Request. Malformed Json. Missing "services" field.'); } // Check permissions according to the data type $dumbSim = new Application\Model\SimModel(); // Customers can only change vpn, advSupervision and location if (isset($data['services']['vpn']) || isset($data['services']['advSupervision']) || isset($data['services']['location'])) { // This requires a permission or another try { $this->_helper->allowed('async_sim_change_supplservices_customer', $dumbSim); } catch (ForbiddenException $e) { $this->_helper->allowed('async_sim_change_supplservices_provider', $dumbSim); } } // Service provider can only change DCA and DIM if (isset($data['services']['dca']) || isset($data['services']['dim'])) { $this->_helper->allowed('async_sim_change_supplservices_provider', $dumbSim); } $watcher = $this->_simSrv->changeSupplServices($data['list'], $data['services']); $this->_helper->filterNotAllowedFields('read_field', $watcher); $this->view->watcher = $watcher; }