InfoRole infoRole = Cloner.copyIRole2InfoRole(role);
InfoRole infoRole = InfoRole.newInfoFromDomain(role);
    public IUserView run(String utilizador, String password, String application)            throws FenixServiceException, ExcepcaoAutenticacao {        IPessoa pessoa = null;        try {            pessoa = SuportePersistenteOJB.getInstance().getIPessoaPersistente().lerPessoaPorUsername(                    utilizador);        } catch (ExcepcaoPersistencia ex) {            throw new FenixServiceException(ex.getMessage());        }        if (pessoa != null && PasswordEncryptor.areEquals(pessoa.getPassword(), password)) {            Collection roles = new ArrayList();            if (pessoa.getPersonRoles() != null) {                Iterator rolesIterator = pessoa.getPersonRoles().iterator();                while (rolesIterator.hasNext()) {                    IRole role = (IRole) rolesIterator.next();                    InfoRole infoRole = Cloner.copyIRole2InfoRole(role);                    roles.add(infoRole);                }            }            UserView userView = new UserView(pessoa.getUsername(), roles);            userView.setFullName(pessoa.getNome());            // Check if the Person is a Candidate            if (userView.hasRoleType(RoleType.MASTER_DEGREE_CANDIDATE)) {                List masterDegreeCandidates = null;                try {                    masterDegreeCandidates = SuportePersistenteOJB.getInstance()                            .getIPersistentMasterDegreeCandidate().readMasterDegreeCandidatesByUsername(                                    userView.getUtilizador());                } catch (ExcepcaoPersistencia ex) {                    ex.printStackTrace(System.out);                    throw new FenixServiceException(ex.getMessage());                }                // Create a list with the active situations of the Candidate                ICandidateView candidateView = null;                List situations = new ArrayList();                Iterator iterator = masterDegreeCandidates.iterator();                while (iterator.hasNext()) {                    IMasterDegreeCandidate masterDegreeCandidate = (IMasterDegreeCandidate) iterator                            .next();                    Iterator situationIter = masterDegreeCandidate.getSituations().iterator();                    while (situationIter.hasNext()) {                        ICandidateSituation candidateSituation = (ICandidateSituation) situationIter                                .next();                        if (candidateSituation.getValidation().equals(new State(State.ACTIVE)))                            situations.add(Cloner                                    .copyICandidateSituation2InfoCandidateSituation(candidateSituation));                    }                }                candidateView = new CandidateView(situations);                userView.setCandidateView(candidateView);            } else                userView.setCandidateView(null);            filterEmployeeRoleFromTeacher(userView);            return filterUserView(userView, application);        }        throw new ExcepcaoAutenticacao("Autenticacao incorrecta");    }