Package it.eng.spagobi.commons.bo

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


        it.eng.spagobi.commons.dao.IUserFunctionalityDAO dao = DAOFactory.getUserFunctionalityDAO();
        String[] functionalities = dao.readUserFunctionality(roles);
        logger.debug("Functionalities retrieved: " + functionalities == null ? "" : functionalities.toString());
       
        List<String> roleFunctionalities = new ArrayList<String>();
        Role virtualRole = getVirtualRole(roles);
       
      if (virtualRole.isAbleToSaveSubobjects()) {
        roleFunctionalities.add(SpagoBIConstants.SAVE_SUBOBJECT_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSeeSubobjects()) {
        roleFunctionalities.add(SpagoBIConstants.SEE_SUBOBJECTS_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSeeSnapshots()) {
        roleFunctionalities.add(SpagoBIConstants.SEE_SNAPSHOTS_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSeeViewpoints()) {
        roleFunctionalities.add(SpagoBIConstants.SEE_VIEWPOINTS_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSeeNotes()) {
        roleFunctionalities.add(SpagoBIConstants.SEE_NOTES_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSendMail()) {
        roleFunctionalities.add(SpagoBIConstants.SEND_MAIL_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSaveIntoPersonalFolder()) {
        roleFunctionalities.add(SpagoBIConstants.SAVE_INTO_FOLDER_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSaveRememberMe()) {
        roleFunctionalities.add(SpagoBIConstants.SAVE_REMEMBER_ME_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSeeMetadata()) {
        roleFunctionalities.add(SpagoBIConstants.SEE_METADATA_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToSaveMetadata()) {
        roleFunctionalities.add(SpagoBIConstants.SAVE_METADATA_FUNCTIONALITY);
      }
      if (virtualRole.isAbleToBuildQbeQuery()) {
        roleFunctionalities.add(SpagoBIConstants.BUILD_QBE_QUERIES_FUNCTIONALITY);
      }
     
      if (!roleFunctionalities.isEmpty()) {
        List<String> roleTypeFunctionalities = Arrays.asList(functionalities);
View Full Code Here


        return userId;
    }
   
  private static Role getVirtualRole(String[] roles) throws Exception {
    logger.debug("IN");
    Role virtualRole = new Role("", "");
    virtualRole.setIsAbleToSaveSubobjects(false);
    virtualRole.setIsAbleToSeeSubobjects(false);
    virtualRole.setIsAbleToSeeSnapshots(false);
    virtualRole.setIsAbleToSeeViewpoints(false);
    virtualRole.setIsAbleToSeeMetadata(false);
    virtualRole.setIsAbleToSaveMetadata(false);
    virtualRole.setIsAbleToSendMail(false);
    virtualRole.setIsAbleToSeeNotes(false);
    virtualRole.setIsAbleToSaveRememberMe(false);
    virtualRole.setIsAbleToSaveIntoPersonalFolder(false);
    virtualRole.setIsAbleToBuildQbeQuery(false);
    if (roles != null) {
      for (int i = 0; i < roles.length; i++) {
        String roleName = roles[i];
        logger.debug("RoleName="+roleName);
        Role anotherRole = DAOFactory.getRoleDAO().loadByName(roleName);
        if (anotherRole!=null) {
          if (anotherRole.isAbleToSaveSubobjects()) {
            logger.debug("User has role " + roleName + " that is able to save subobjects.");
            virtualRole.setIsAbleToSaveSubobjects(true);
          }
          if (anotherRole.isAbleToSeeSubobjects()) {
            logger.debug("User has role " + roleName + " that is able to see subobjects.");
            virtualRole.setIsAbleToSeeSubobjects(true);
          }
          if (anotherRole.isAbleToSeeViewpoints()) {
            logger.debug("User has role " + roleName + " that is able to see viewpoints.");
            virtualRole.setIsAbleToSeeViewpoints(true);
          }
          if (anotherRole.isAbleToSeeSnapshots()) {
            logger.debug("User has role " + roleName + " that is able to see snapshots.");
            virtualRole.setIsAbleToSeeSnapshots(true);
          }
          if (anotherRole.isAbleToSeeMetadata()) {
            logger.debug("User has role " + roleName + " that is able to see metadata.");
            virtualRole.setIsAbleToSeeMetadata(true);
          }
          if (anotherRole.isAbleToSaveMetadata()) {
            logger.debug("User has role " + roleName + " that is able to save metadata.");
            virtualRole.setIsAbleToSaveMetadata(true);
          }
          if (anotherRole.isAbleToSendMail()) {
            logger.debug("User has role " + roleName + " that is able to send mail.");
            virtualRole.setIsAbleToSendMail(true);
          }
          if (anotherRole.isAbleToSeeNotes()) {
            logger.debug("User has role " + roleName + " that is able to see notes.");
            virtualRole.setIsAbleToSeeNotes(true);
          }
          if (anotherRole.isAbleToSaveRememberMe()) {
            logger.debug("User has role " + roleName + " that is able to save remember me.");
            virtualRole.setIsAbleToSaveRememberMe(true);
          }
          if (anotherRole.isAbleToSaveIntoPersonalFolder()) {
            logger.debug("User has role " + roleName + " that is able to save into personal folder.");
            virtualRole.setIsAbleToSaveIntoPersonalFolder(true);
          }
          if (anotherRole.isAbleToBuildQbeQuery()) {
            logger.debug("User has role " + roleName + " that is able to build QBE queries.");
            virtualRole.setIsAbleToBuildQbeQuery(true);
          }
        }
      }
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.