Package it.eng.spagobi.commons.bo

Examples of it.eng.spagobi.commons.bo.Role


        List lstRoles = userDao.loadSbiUserRolesById(sbiUserId);
        boolean isAdminUser = false;

        for (int i=0; i<lstRoles.size(); i++){
          SbiExtRoles tmpRole = (SbiExtRoles)lstRoles.get(i);
          Role role = DAOFactory.getRoleDAO().loadByID(tmpRole.getExtRoleId());
          if (role.getName().equals(strAdminPatter)){
            isAdminUser = true;
            logger.debug("User is administrator. Checks on the password are not applied !");
            break;
          }
        }
View Full Code Here


  public List getCorrectRolesForExecution(Integer id) throws EMFUserError {
    logger.debug("IN");
    List roles = DAOFactory.getRoleDAO().loadAllRoles();
    List nameRoles = new ArrayList();
    Iterator iterRoles = roles.iterator();
    Role role = null;
    while(iterRoles.hasNext()) {
      role = (Role)iterRoles.next();
      nameRoles.add(role.getName());
    }
    logger.debug("OUT");
    return getCorrectRoles(id, nameRoles);
  }
View Full Code Here

      roles = new ArrayList();
      Iterator it = roleNames.iterator();
      while(it.hasNext()) {
        String roleName = (String)it.next();
        try {
          Role role = DAOFactory.getRoleDAO().loadByName(roleName);
          roles.add(role);
        } catch (EMFUserError error) {
          logger.error("Role with name equals to [" + roleName + "] not found");
          throw new SpagoBIServiceException(SERVICE_NAME, "Role with name equals to [" + roleName + "] not found", error);
        }
View Full Code Here

      }
      else{ // if no parent all roles enabled
        List allRoles = DAOFactory.getRoleDAO().loadAllRoles();
        roles= new Role[allRoles.size()];
        for(int i=0; i<allRoles.size(); i++) {
          Role role = (Role)allRoles.get(i);
          roles[i]=role;

        }

      }
View Full Code Here

    if( !(o instanceof Role) ) {
      throw new SerializationException("RoleJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      Role role = (Role)o;
      result = new JSONObject();
     
      result.put(ROLE_ID, role.getId() );
      result.put(ROLE_NAME, role.getName() );
      result.put(ROLE_DESCRIPTION, role.getDescription() );
      result.put(ROLE_CODE, role.getCode() );
      result.put(ROLE_TYPE_ID, role.getRoleTypeID() );
      result.put(ROLE_TYPE_CD, role.getRoleTypeCD() );
      result.put(SAVE_PERSONAL_FOLDER, role.isAbleToSaveIntoPersonalFolder() );
      result.put(SAVE_META, role.isAbleToSaveMetadata());
      result.put(SAVE_REMEMBER, role.isAbleToSaveRememberMe() );
      result.put(SAVE_SUBOBJ, role.isAbleToSaveSubobjects() );
      result.put(SEE_META, role.isAbleToSeeMetadata() );
      result.put(SEE_NOTES, role.isAbleToSeeNotes() );
      result.put(SEE_SNAPSHOT, role.isAbleToSeeSnapshots() );
      result.put(SEE_SUBOBJ, role.isAbleToSeeSubobjects() );
      result.put(SEE_VIEWPOINTS, role.isAbleToSeeViewpoints() );
      result.put(SEND_MAIL, role.isAbleToSendMail() );
      result.put(BUILD_QBE, role.isAbleToBuildQbeQuery() );
      result.put(DEFAULT_ROLE, role.isDefaultRole() );
     
     
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
View Full Code Here

      SbiMenuRole hibMenuRole = (SbiMenuRole)iterRoles.next();

      SbiExtRoles hibRole =hibMenuRole.getSbiExtRoles();

      RoleDAOHibImpl roleDAO =  new RoleDAOHibImpl();
      Role role = roleDAO.toRole(hibRole);

      rolesList.add(role);
    }

    Role[] rolesD = new Role[rolesList.size()];
View Full Code Here

    criteria = aSession.createCriteria(SbiMenuRole.class);
    Role[] roles = null;
    roles = aMenu.getRoles();

    for(int i=0; i<roles.length; i++) {
      Role role = roles[i];
      domainCdCriterrion = Expression.eq("extRoleId", role.getId());
      criteria = aSession.createCriteria(SbiExtRoles.class);
      criteria.add(domainCdCriterrion);
      SbiExtRoles hibRole = (SbiExtRoles)criteria.uniqueResult();

      SbiMenuRoleId sbiMenuRoleId = new SbiMenuRoleId();
      sbiMenuRoleId.setMenuId(hibMenu.getMenuId());
      sbiMenuRoleId.setExtRoleId(role.getId());

      SbiMenuRole sbiMenuRole= new SbiMenuRole();
      sbiMenuRole.setId(sbiMenuRoleId);
      sbiMenuRole.setSbiMenu(hibMenu);
      sbiMenuRole.setSbiExtRoles(hibRole);
View Full Code Here

        nameRoles = (String) roleSB.getAttribute("name");
        deswcRoles = (String) roleSB.getAttribute("desc");
        if (nameRoles == null) {
          logger.error("Error while reading config file.");
        }
        groups.add(new Role(nameRoles, deswcRoles));
      }
    }
    logger.debug("OUT");
    return groups;
  }
View Full Code Here

      List exportedRoles = this.getExportedRoles();
      IRoleDAO roleDAO = DAOFactory.getRoleDAO();
      List currentRoles = roleDAO.loadAllRoles();
      Iterator exportedRolesIt = exportedRoles.iterator();
      while (exportedRolesIt.hasNext()) {
        Role exportedRole = (Role) exportedRolesIt.next();
        String associatedRoleName = this.getUserAssociation().getAssociatedRole(exportedRole.getName());
        if (associatedRoleName == null || associatedRoleName.trim().equals("")) return true;
        Iterator currentRolesIt = currentRoles.iterator();
        boolean associatedRoleNameExists = false;
        while (currentRolesIt.hasNext()) {
          Role currentRole = (Role) currentRolesIt.next();
          if (currentRole.getName().equals(associatedRoleName)) {
            associatedRoleNameExists = true;
            metaAss.insertCoupleRole(exportedRole.getId(), currentRole.getId());
            break;
          }
        }
        if (!associatedRoleNameExists) return true;
      }
View Full Code Here

   * @param group Group of the portal
   * @param orgService OrganizationService of the portal
   * @param roles List of roles (list of it it.eng.spagobi.bo.Role)
   */
  private void add(Group group, OrganizationService orgService, List roles){
    Role role = new Role(group.getId(), group.getDescription());
      roles.add(role);
      try{
        Collection children = orgService.getGroupHandler().findGroups(group);
        if ((children == null) || (children.size() == 0)){
          // End recursion
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.bo.Role

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.