protected function _checkReadPermisions(Application\Model\ListResultModel $list)
 {
     $preBills = $list->getItems();
     $result = array();
     foreach ($preBills as $key => $preBill) {
         try {
             $this->_helper->allowed('read', $preBill);
             $preBill->fileName = null;
             $result[] = $preBill;
         } catch (ForbiddenException $e) {
             //Nothing to do.
         }
     }
     $list->setItems($result);
     return $list;
 }
 protected function _checkReadPermisions(Application\Model\ListResultModel $list)
 {
     $supplServicess = $list->getItems();
     if ($supplServicess !== null) {
         $result = array();
         foreach ($supplServicess as $key => $supplServices) {
             try {
                 $this->_helper->allowed('read', $supplServices);
                 $this->_helper->filterNotAllowedFields('read_field', $supplServices);
                 $result[] = $supplServices;
             } catch (AppEx\ForbiddenException $e) {
                 $list->setCount($list->getCount() - 1);
             }
         }
         $list->setItems($result);
     }
     return $list;
 }
 public function findAll($filterList = NULL, $params = NULL)
 {
     $data = array();
     if (isset($params['lifeCycleId'])) {
         $data['extraFields'] = array('life_cycle_id' => $params['lifeCycleId']);
     }
     $resultList = $this->_findAllEricsson($data);
     $items = array();
     foreach ($resultList['items'] as $key => $value) {
         $items[] = new \Application\Model\LifeCycleModel($value);
     }
     $result = new \Application\Model\ListResultModel();
     $result->setItems($items);
     if (isset($resultList['count'])) {
         $result->setCount($resultList['count']);
     }
     return $result;
 }
 protected function _checkReadPermisions(Application\Model\ListResultModel $list)
 {
     $sims = $list->getItems();
     $result = array();
     foreach ($sims as $key => $sim) {
         try {
             $this->_helper->allowed('preinventory_read_sim', $sim);
             $result[] = $sim;
         } catch (AppEx\ForbiddenException $e) {
             //Nothing to do.
         }
     }
     $list->setItems($result);
     return $list;
 }
 protected function _checkReadPermisions(Application\Model\ListResultModel $list)
 {
     $item = $list->getItems();
     if ($item !== null) {
         $result = array();
         foreach ($item as $key => $item) {
             try {
                 $this->_helper->allowed('read', $item);
                 $result[] = $item;
             } catch (AppEx\ForbiddenException $e) {
                 //Nothing to do.
             }
         }
         $list->setItems($result);
     }
     return $list;
 }
 protected function _checkReadRights(Application\Model\ListResultModel $list)
 {
     $sims = $list->getItems();
     $result = array();
     foreach ($sims as $key => $sim) {
         try {
             $this->_helper->allowed('read', $sim);
             $result[] = $sim;
         } catch (ForbiddenException $e) {
             $list->setCount($list->getCount() - 1);
         }
     }
     $list->setItems($result);
     return $list;
 }
 /**
  * @param  null                               $filterList
  * @param  null                               $params
  * @return \Application\Model\ListResultModel
  */
 public function findAll($filterList = NULL, $params = NULL)
 {
     $data = array();
     if (isset($params['customer'])) {
         $orgProto = $this->_createOrganization($params['customer']);
         $data['extraFields'] = array('organization' => $orgProto->serialize(new \DrSlump\Protobuf\Codec\PhpArray()));
     }
     if (isset($params['paging'])) {
         $data['paging'] = $params['paging'];
     }
     $resultList = $this->_findAllEricsson($data);
     $items = array();
     foreach ($resultList['items'] as $key => $value) {
         $items[] = new Model\SupplServicesModel($value);
     }
     $result = new \Application\Model\ListResultModel();
     $result->setItems($items);
     if (isset($resultList['count'])) {
         $result->setCount($resultList['count']);
     }
     return $result;
 }