Package org.infoglue.cms.security

Examples of org.infoglue.cms.security.InfoGluePrincipal


        return null;
      else
        return (InfoGluePrincipal)infoGluePrincipalCandidate;
    }
     
      InfoGluePrincipal infoGluePrincipal = getAuthorizationModule().getAuthorizedInfoGluePrincipal(userName);
    
    if(infoGluePrincipal != null)
      CacheController.cacheObjectInAdvancedCache("principalCache", userName, infoGluePrincipal, new String[]{}, false);
    else
      CacheController.cacheObjectInAdvancedCache("principalCache", userName, new NullObject(), new String[]{}, false);
View Full Code Here


 
  public InfoGluePrincipal createUser(SystemUserVO systemUserVO) throws ConstraintException, SystemException, Exception
  {
    getAuthorizationModule().createInfoGluePrincipal(systemUserVO);

    return new InfoGluePrincipal(systemUserVO.getUserName(), systemUserVO.getUserName(), systemUserVO.getFirstName(), systemUserVO.getLastName(), systemUserVO.getEmail(), systemUserVO.getSource(), systemUserVO.getIsActive(), systemUserVO.getModifiedDateTime(), new ArrayList(), new ArrayList(), new HashMap(), false, getAuthorizationModule());
    //return getUser(systemUserVO.getUserName());
  }
View Full Code Here

  {
    UserPropertiesVO realUserPropertiesVO = userPropertiesVO;
     
    if(userPropertiesVO.getId() == null)
    {
      InfoGluePrincipal infoGluePrincipal = UserControllerProxy.getController().getUser(userPropertiesVO.getUserName());
      List userPropertiesVOList = UserPropertiesController.getController().getUserPropertiesVOList(infoGluePrincipal.getName(), languageId);
      if(userPropertiesVOList != null && userPropertiesVOList.size() > 0)
      {
        realUserPropertiesVO = (UserPropertiesVO)userPropertiesVOList.get(0);
        realUserPropertiesVO.setValue(userPropertiesVO.getValue())
      }
View Full Code Here

            contentVersionVO.setVersionModifier(getInfoGluePrincipal().getName());
            contentVersionVO.setVersionValue(versionValue);
        contentVersionVO = ContentVersionController.getContentVersionController().create(pageMetaInfoContentVO.getId(), this.masterLanguageVO.getId(), contentVersionVO, null);
      }
     
      ContentVersionController.getContentVersionController().updateAttributeValue(contentVersionVO.getContentVersionId(), "ComponentStructure", componentXML, new InfoGluePrincipal("ComponentEditor", "none", "none", "none", new ArrayList(), new ArrayList(), true, null));
    }
   
    this.url = getComponentRendererUrl() + getComponentRendererAction() + "?siteNodeId=" + this.siteNodeId + "&languageId=" + this.languageId + "&contentId=" + this.contentId + "&activatedComponentId=" + newComponentId + "&showSimple=" + this.showSimple + "&stateChanged=" + this.stateChanged;
    //this.getResponse().sendRedirect(url);   
   
View Full Code Here

            contentVersionVO.setVersionModifier(getInfoGluePrincipal().getName());
            contentVersionVO.setVersionValue(versionValue);
        contentVersionVO = ContentVersionController.getContentVersionController().create(templateContentVO.getId(), languageId, contentVersionVO, null);
      }
     
      ContentVersionController.getContentVersionController().updateAttributeValue(contentVersionVO.getContentVersionId(), "ComponentStructure", componentXML, new InfoGluePrincipal("ComponentEditor", "none", "none", "none", new ArrayList(), new ArrayList(), true, null));
    }
    else
    {
        String componentXML   = getPageComponentsString(siteNodeId, this.masterLanguageVO.getId());     
       
View Full Code Here

                }
              }
             
              if(!skipDisplayName)
              {
                InfoGluePrincipal principal = (InfoGluePrincipal)getInfoGluePrincipal(snVO.getVersionModifier(), db);
                if(principal != null)
                {
                  if(principal.getName().equalsIgnoreCase(principal.getDisplayName()))
                    skipDisplayName = true;
                 
                  snVO.setVersionModifierDisplayName(principal.getDisplayName());
                }
              }
              snVO.setPath(getSiteNodePath(snVO.getSiteNodeId(), db));
            }
            else
              logger.info("Not adding siteNodeVersion..");
          }

            this.siteNodeVersionVOList.addAll(siteNodeVersionVOList);
            Collections.sort(this.siteNodeVersionVOList, Collections.reverseOrder(new ReflectionComparator("modifiedDateTime")));
 
          processBean.updateProcess("Getting modifier and path to found contents.");
 
          for(ContentVersionVO contentVersionVO : contentVersionVOList)
          {
            if(contentVersionVO.getStateId() == 0
            {
              Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId, db);
              if(protectedContentId != null)
              {
                boolean hasAnonymousUserAccess = AccessRightController.getController().getIsPrincipalAuthorized(db, UserControllerProxy.getController().getUser(CmsPropertyHandler.getAnonymousUser()), "Content.Read", protectedContentId.toString(), false);
                if(!hasAnonymousUserAccess)
                {
                  anonymousNoAccessWarning = true;
                  contentVersionVO.setHasAnonymousUserAccess(false);
                }
              }

              if(!skipDisplayName)
              {
                InfoGluePrincipal principal = (InfoGluePrincipal)getInfoGluePrincipal(contentVersionVO.getVersionModifier(), db);
                if(principal != null)
                {
                  if(principal.getName().equalsIgnoreCase(principal.getDisplayName()))
                    skipDisplayName = true;
                 
                  contentVersionVO.setVersionModifierDisplayName(principal.getDisplayName());
                }
              }
              contentVersionVO.setPath(getContentPath(contentVersionVO.getContentId(), db));
            }
            else
View Full Code Here

              event.setEntityId(SiteNodeVersionController.getController().getSiteNodeVersionWithId(event.getEntityId(), db).getOwningSiteNode().getId());
            }
          }

          //InfoGluePrincipal infoGluePrincipal = InfoGluePrincipalControllerProxy.getController().getInfoGluePrincipal(event.getCreator());
          InfoGluePrincipal infoGluePrincipal = UserControllerProxy.getController().getUser(event.getCreator());

          String email = (infoGluePrincipal!=null) ? infoGluePrincipal.getEmail() : publisher.getEmail();
      if(infoGluePrincipal == null)
        comment += "\n\n\n(" +  event.getCreator() + " wasn't found.)";

          mailNotification(event, publisher.getName(), publisher.getEmail(), email, comment, referenceUrl);
View Full Code Here

      {
        EventVO eventVO = (EventVO)eventIterator.next();

        Event event = EventController.getEventWithId(eventVO.getId(), db);
        //InfoGluePrincipal infoGluePrincipal = InfoGluePrincipalControllerProxy.getController().getInfoGluePrincipal(event.getCreator());
            InfoGluePrincipal infoGluePrincipal = UserControllerProxy.getController().getUser(event.getCreator());

        if(event.getTypeId().intValue() == EventVO.PUBLISH.intValue())
        {
          event.setTypeId(EventVO.PUBLISH_DENIED);
          if(event.getEntityClass().equals(ContentVersion.class.getName()))
          {
            ContentVersion contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(event.getEntityId(), db);
            if(contentVersion.getStateId().intValue() == ContentVersionVO.PUBLISHED_STATE.intValue())
            {
              //If its a published version we just deletes the event - we don't want to delete the version.
              EventController.delete(event, db);
            }
            else
            {
              Content content = contentVersion.getOwningContent();
              Language language = contentVersion.getLanguage();
              //event.setEntityId(ContentVersionController.getPreviousContentVersionVO(content.getId(), language.getId(), contentVersion.getId()).getId());
              ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getPreviousActiveContentVersionVO(content.getId(), language.getId(), contentVersion.getId(), db);
              if(contentVersionVO != null && event != null)
                event.setEntityId(contentVersionVO.getId());
             
              ContentVersionController.getContentVersionController().delete(contentVersion, db);
            }
          }
          else if(event.getEntityClass().equals(SiteNodeVersion.class.getName()))
          {
            SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(event.getEntityId(), db);
            if(siteNodeVersion.getStateId().intValue() == SiteNodeVersionVO.PUBLISHED_STATE.intValue())
            {
              //If its a published version we just deletes the event - we don't want to delete the version.
              EventController.delete(event, db);
            }
            else
            {
              SiteNode siteNode = siteNodeVersion.getOwningSiteNode();
              //event.setEntityId(SiteNodeVersionController.getPreviousSiteNodeVersionVO(siteNode.getId(), siteNodeVersion.getId()).getId());
              SiteNodeVersion previousSiteNodeVersion = SiteNodeVersionController.getController().getPreviousActiveSiteNodeVersion(siteNode.getId(), siteNodeVersion.getId(), db);
              if(previousSiteNodeVersion != null && event != null)
                event.setEntityId(previousSiteNodeVersion.getId());
              SiteNodeVersionController.getController().delete(siteNodeVersion, db);
              SiteNodeStateController.getController().changeStateOnMetaInfo(db, siteNode.getValueObject(), previousSiteNodeVersion.getValueObject(), previousSiteNodeVersion.getStateId(), "Denied publication", true, infoGluePrincipal, new ArrayList());
              //db.remove(siteNodeVersion);
            }
          }
        }
        else if(event.getTypeId().intValue() == EventVO.UNPUBLISH_LATEST.intValue())
        {
          event.setTypeId(EventVO.UNPUBLISH_DENIED);
          if(event.getEntityClass().equals(ContentVersion.class.getName()))
          {
            event.setEntityClass(Content.class.getName());
            event.setEntityId(ContentVersionController.getContentVersionController().getContentVersionWithId(event.getEntityId(), db).getOwningContent().getId());
          }
          else if(event.getEntityClass().equals(SiteNodeVersion.class.getName()))
          {
            event.setEntityClass(SiteNode.class.getName());
            event.setEntityId(SiteNodeVersionController.getController().getSiteNodeVersionWithId(event.getEntityId(), db).getOwningSiteNode().getId());
          }
        }

        String email = (infoGluePrincipal!=null) ? infoGluePrincipal.getEmail() : publisher.getEmail();
        if(infoGluePrincipal == null)
          comment += "\n\n\n(" +  event.getCreator() + " wasn't found.)";
       
        mailNotification(event, publisher.getName(), publisher.getEmail(), email, comment, referenceUrl);
      }
View Full Code Here

      }
     
      Iterator usersIterator = users.iterator();
    while(usersIterator.hasNext())
    {
      InfoGluePrincipal infogluePrincipal = (InfoGluePrincipal)usersIterator.next();
      if(infogluePrincipal.getGroups() == null || infogluePrincipal.getGroups().size() == 0)
        infogluePrincipal = UserControllerProxy.getController(db).getUser(infogluePrincipal.getName());
         
      boolean hasAccessToPublishingTool = hasAccessTo("PublishingTool.Read", infogluePrincipal);
     
      if(hasAccessToPublishingTool)
      {
        boolean hasAccessToRepository = hasAccessTo("Repository.Read", "" + repositoryId, infogluePrincipal);
        if(!hasAccessToRepository)
          hasAccessToRepository = hasAccessTo("Repository.Write", "" + repositoryId, infogluePrincipal);
        if(hasAccessToRepository)
        {
          if(recipients.indexOf(infogluePrincipal.getEmail()) == -1)
          {
            if(recipients.length() > 0)
                recipients += ";";

              recipients += infogluePrincipal.getEmail();
          }
        }
      }
    }
     
View Full Code Here

        logger.info("Actually stored it:" + object + ":" + modified);
         
      String userName = "SYSTEM";
      try
      {
        InfoGluePrincipal principal = InfoGlueAbstractAction.getSessionInfoGluePrincipal();
        if(principal != null && principal.getName() != null)
          userName = principal.getName();       
      }
      catch (NoClassDefFoundError e){}
     
      Timer t = new Timer();
        Map extraInfo = CacheController.getExtraInfo(SiteNodeVersionImpl.class.getName(), getObjectIdentity(object).toString());
View Full Code Here

TOP

Related Classes of org.infoglue.cms.security.InfoGluePrincipal

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.