Package it.eng.spago.security

Examples of it.eng.spago.security.IEngUserProfile


        return;
      }
      BIObject document=null;
      document = DAOFactory.getBIObjectDAO().loadBIObjectById(id);

      IEngUserProfile profile=getUserProfile();

      // CALL EXPORTER
      logger.debug("call exporter");
      DocumentCompositionExporter exporter=new DocumentCompositionExporter();
      tmpFile=exporter.exportDocumentCompositionPDF(tmpFile,docCompConf, document, profile, currentConfigurationsMap, documents, defaultStyle);
View Full Code Here


  static private Logger logger = Logger.getLogger(AbstractSDKService.class);
 
  protected IEngUserProfile getUserProfile() throws Exception {
    logger.debug("IN");
    IEngUserProfile profile = null;
    try {
      MessageContext mc = MessageContext.getCurrentContext();
      profile = (IEngUserProfile) mc.getProperty(IEngUserProfile.ENG_USER_PROFILE);
      if (profile == null) {
        logger.debug("User profile not found.");
        String userIdentifier = (String) mc.getProperty(WSHandlerConstants.USER);
        logger.debug("User identifier found = [" + userIdentifier + "].");
        if (userIdentifier == null) {
          logger.warn("User identifier not found!! cannot build user profile object");
          throw new Exception("Cannot create user profile");
        } else {
          try {
            profile = UserUtilities.getUserProfile(userIdentifier);
            logger.debug("User profile for userId [" + userIdentifier + "] created.");
          } catch (Exception e) {
            logger.error("Exception creating user profile for userId [" + userIdentifier + "]!", e);
            throw new Exception("Cannot create user profile");
          }
        }
        mc.setProperty(IEngUserProfile.ENG_USER_PROFILE, profile);
      } else {
        logger.debug("User profile for user [" + profile.getUserUniqueIdentifier() + "] retrieved.");
      }
      UserProfile userProfile = (UserProfile) profile;
      logger.info("User profile retrieved: userId = [" + userProfile.getUserId() + "]; username = [" + userProfile.getUserName() + "]");
    } finally {
      logger.debug("OUT");
View Full Code Here

   */
  protected void checkUserPermissionForFunctionality(String userFunctionality, String errorMessage)
            throws NotAllowedOperationException, Exception {
    logger.debug("IN");
    try {
      IEngUserProfile profile = getUserProfile();
      UserProfile userProfile = (UserProfile) profile;
        if (!userProfile.isAbleToExecuteAction(userFunctionality)) {
          logger.error("Current user [" + userProfile.getUserId() + "] has no rights for " + userFunctionality + " functionality.");
          NotAllowedOperationException e = new NotAllowedOperationException();
          e.setFaultString(errorMessage);
View Full Code Here

    // get the lov provider
    String looProvider = modVal.getLovProvider();
    // get from the request the type of lov
    String typeLov = LovDetailFactory.getLovTypeCode(looProvider);
    // get the user profile
    IEngUserProfile profile = null;
    SessionContainer permanentSession = session.getPermanentContainer();
    profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
//    HttpServletRequest httpReq = (HttpServletRequest)requestContainer.getInternalRequest();
//    HttpSession httpSess = httpReq.getSession();
//    profile = (IEngUserProfile)httpSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
View Full Code Here

  /* (non-Javadoc)
   * @see it.eng.spago.dispatching.service.list.basic.IFaceBasicListService#getList(it.eng.spago.base.SourceBean, it.eng.spago.base.SourceBean)
   */
  public ListIFace getList(SourceBean request, SourceBean response) throws Exception {
    RequestContainer requestContainer = getRequestContainer();
    IEngUserProfile profile = (IEngUserProfile) requestContainer.getSessionContainer().getPermanentContainer().getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    
    //Start writing log in the DB
    Session aSession =null;
    try {
      aSession = HibernateUtil.currentSession();
View Full Code Here

        logger.error("No document specified");
        return;
      }
      logger.debug("Input document: id=[" + biobj.getId() + "], name=[" + biobj.getName() + "], label=[" + biobj.getLabel() + "]");
        // creates the user profile
      IEngUserProfile profile =null;
      try{
        profile = UserUtilities.getUserProfile(user);
        } catch (Exception e) {
          logger.error("An error occurred while creating the profile of user [" + user + "]");
          throw new SecurityException("An error occurred while creating the profile of user [" + user + "]", e);
        }       

        // Check if the user can execute the document
        boolean canSee = ObjectsAccessVerifier.canSee(biobj, profile);
        if (!canSee) {
          logger.error("Current user cannot execute the required document");
          throw new SecurityException("Current user cannot execute the required document");
        }
        Integer id = biobj.getId();
        // get the correct roles for execution
      List correctRoles = null;
      if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_DEV)
          || profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_USER)
          || profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN))
        correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(id, profile);
      else
        correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(id);
      logger.debug("correct roles for execution retrived " + correctRoles);
      if (correctRoles == null || correctRoles.size() == 0) {
View Full Code Here

    //Start writing log in the DB
    Session aSession =null;
    try {
      aSession = HibernateUtil.currentSession();
      Connection jdbcConnection = aSession.connection();
      IEngUserProfile profile = UserUtilities.getUserProfile();
      AuditLogUtilities.updateAudit(jdbcConnection,  profile, "activity.DistribListMenu", null);
    } catch (HibernateException he) {
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
      }
    }
    //End writing log in the DB

    RequestContainer aRequestContainer = RequestContainer.getRequestContainer();
    SessionContainer aSessionContainer = aRequestContainer.getSessionContainer();

    IEngUserProfile userProfile =UserUtilities.getUserProfile();
    String userId="";
    if (userProfile!=null) userId=(String)((UserProfile)userProfile).getUserId();
    //sets the userid as input parameter for the query fo statements.xml
    aSessionContainer.setAttribute(SsoServiceInterface.USER_ID ,userId);
View Full Code Here

    logger.debug("IN");
    try {
      RequestContainer reqCont = getRequestContainer();
      SessionContainer sessCont = reqCont.getSessionContainer();
      SessionContainer permSess = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);

      IDistributionListDAO dao=DAOFactory.getDistributionListDAO();
      dao.setUserProfile(profile);
      DistributionList dlNew = recoverDistributionListDetails(serviceRequest);
     
View Full Code Here

  public void doService() {
    logger.debug("IN");
    HttpServletResponse httpResponse = getHttpResponse();
    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer permanentSession = requestContainer.getSessionContainer().getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    IRoleDAO roleDao;
    try {
      roleDao = DAOFactory.getRoleDAO();
      roleDao.setUserProfile(profile);
    } catch (EMFUserError e1) {
View Full Code Here

public class ExecuteBIDocumentJob implements Job {

  static private Logger logger = Logger.getLogger(ExecuteBIDocumentJob.class)

  public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
    IEngUserProfile profile;
    JobDataMap jobDataMap;
   
    // documentLabel__num this is necessary because the same document can be added to one scheduled activity more than one time
    String documentInstanceName;
    String documentLabel;
View Full Code Here

TOP

Related Classes of it.eng.spago.security.IEngUserProfile

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.