Package ecar.bean

Examples of ecar.bean.AcessoRelatorio


        List usuariosPermitidos = itemEstUsutpfuacDao.getUsuariosAcompanhamento(arel.getAcompReferenciaItemAri().getItemEstruturaIett());

        for (Iterator itTpfa = listTipoFuncAcompTpfa.iterator(); itTpfa.hasNext();) {
            TipoFuncAcompTpfa tpfa = (TipoFuncAcompTpfa)itTpfa.next();
           
          AcessoRelatorio acessoRelatorio = new AcessoRelatorio();
          acessoRelatorio.setArel(arel);
          acessoRelatorio.setTpfa(tpfa);
       
          if(!usuariosPermitidos.contains(usuario)) {
            acessoRelatorio.setPermissao(OPERACAO_NEGADA_USUARIO_SEM_PERMISSAO);
          } else {
          if(arel != null && Dominios.SIM.equals(arel.getIndLiberadoArel())) {
              acessoRelatorio.setPermissao(OPERACAO_PERMITIDA);
          } else {
           
            TipoAcompFuncAcompTafc tafc = null;
            for(Iterator it = listTipoAcompFuncAcomp.iterator(); it.hasNext();){
              TipoAcompFuncAcompTafc tafcTemp = (TipoAcompFuncAcompTafc) it.next();
              if(tafcTemp.getTipoFuncAcompTpfa().equals(tpfa)){
                tafc = tafcTemp;
                break;
              }
            }
           
              try {
              if(tafc != null){
                /*
                 * Nova regra (mantis 11289):
                 * Ao exibir as abas de tipos de fun��es de acompanhamento:
                 * Para registro de posi��o OBRIGAT�RIO continua com est� atualmente.
                 */
                if(Dominios.OBRIGATORIO.equals(tafc.getIndRegistroPosicaoTafc())){
                 
                  boolean usuarioSemPermissao = true;
                      ItemEstUsutpfuacIettutfa itemEstUsutpfuacIettutfa = new ItemEstUsutpfuacDao(request).buscar(arel.getAcompReferenciaItemAri().getItemEstruturaIett().getCodIett(), tpfa.getCodTpfa());
                   
                      if (itemEstUsutpfuacIettutfa != null){
                        if (itemEstUsutpfuacIettutfa.getUsuarioUsu() != null && itemEstUsutpfuacIettutfa.getUsuarioUsu().equals(usuario)){
                          usuarioSemPermissao = false;
                        } else if (itemEstUsutpfuacIettutfa.getSisAtributoSatb() != null){
                          Iterator itUsuarios = new UsuarioDao().getUsuariosBySisAtributoSatb(itemEstUsutpfuacIettutfa.getSisAtributoSatb()).iterator();
                          while (itUsuarios.hasNext()){
                            UsuarioUsu usu = (UsuarioUsu) itUsuarios.next();
                            if (usu.equals(usuario)){
                              usuarioSemPermissao = false;
                            }
                          }
                        }
                      }
                      if (usuarioSemPermissao){
                        acessoRelatorio.setPermissao(OPERACAO_NEGADA_POSICAO_EM_EDICAO);
                      } else {
                        acessoRelatorio.setPermissao(OPERACAO_PERMITIDA);
                      }

                }
                /*
                 * Para tipo de fun��o de acompanhamento que seja OPCIONAL o registro de posi��o no tipo de
                 * acompanhamento selecionado (TipoAcompFuncAcompTafc.indRegistroPosicaoTafc),
                 * somente apresentar a aba para o usu�rio que possuir permiss�o
                 * ou que o acompanhamento esteja liberado.
                 */
                else if(Dominios.OPCIONAL.equals(tafc.getIndRegistroPosicaoTafc())){
                  if(usuariosPermitidos.contains(usuario)){                   
                    acessoRelatorio.setPermissao(OPERACAO_PERMITIDA);                   
                  }else{
                    acessoRelatorio.setPermissao(OPERACAO_NEGADA_USUARIO_SEM_PERMISSAO);
                  }
                }
              }
              } catch(ECARException e) {
                  acessoRelatorio.setPermissao(OPERACAO_NEGADA_POSICAO_EM_EDICAO);
              }
          }
          }
          retorno.add(acessoRelatorio);
          }
View Full Code Here

TOP

Related Classes of ecar.bean.AcessoRelatorio

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.