Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.AccessConstraintExceptionBuffer


    return doAddUser();
    }
 
  public String doDeleteUser() throws Exception
    {  
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    if(this.extraMultiParameter == null || this.extraMultiParameter.length == 0)
    {
      if(interceptionPointCategory.equalsIgnoreCase("Content"))
      { 
        Integer contentId = new Integer(parameters);
        ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
        if(!contentVO.getCreatorName().equalsIgnoreCase(this.getInfoGluePrincipal().getName()))
        {
          Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
          if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.ChangeAccessRights", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "1006"));
        }
      }
      else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
      { 
        Integer siteNodeVersionId = new Integer(parameters);
        SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId);
       
        //If in published state we must first make it working state so it can later be published
        if(siteNodeVersionVO.getStateId().intValue() != SiteNodeVersionVO.WORKING_STATE)
        {
          this.oldParameters = "" + siteNodeVersionId;
          //System.out.println("We better state change....");
          List events = new ArrayList();
          //System.out.println("OLd siteNodeVersionVO:" + siteNodeVersionVO.getId());
          siteNodeVersionVO = SiteNodeStateController.getController().changeState(siteNodeVersionVO.getId(), SiteNodeVersionVO.WORKING_STATE, "Access right changes", true, this.getInfoGluePrincipal(), siteNodeVersionVO.getSiteNodeId(), events);
          //System.out.println("New siteNodeVersionVO:" + siteNodeVersionVO.getId());
          this.newParameters = "" + siteNodeVersionVO.getId();
          this.parameters = "" + siteNodeVersionVO.getId();
          siteNodeVersionId = siteNodeVersionVO.getId();
        }

        if(!siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(this.getInfoGluePrincipal().getName()))
        {
          Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
          if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "SiteNodeVersion.ChangeAccessRights", siteNodeVersionId.toString()))
            ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1006"));
        }
      }
     
      ceb.throwIfNotEmpty();
    }
   
    String userName = this.getRequest().getParameter("userName");
    if(this.extraMultiParameter != null && this.extraMultiParameter.length > 0)
    {
View Full Code Here


   * ask the user for a comment as this is to be regarded as a new version.
   */
    
    public String doExecute() throws Exception
    {
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
    if(this.stateId.intValue() == 2)
    {
      if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.SubmitToPublish", protectedContentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1005"));
    }
    else
    {
      if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.CreateVersion", protectedContentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1007"));     
    }
   
    ceb.throwIfNotEmpty();

      //If the comment is not null we carry out the stateChange
      if(getStateId().intValue() == 2 && getVersionComment() == null)
      {
        return "commentVersion";
View Full Code Here

      {
        Timer t = new Timer();
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(this.contentId);
          this.repositoryId = contentVO.getRepositoryId();
         
        AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
     
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.SubmitToPublish", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1005"));
       
        ceb.throwIfNotEmpty();
 
        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ViewListContentVersion part 1", t.getElapsedTime());
       
        //Set<SiteNodeVersionVO> siteNodeVersionVOList = new HashSet<SiteNodeVersionVO>();
        //Set<ContentVersionVO> contentVersionVOList = new HashSet<ContentVersionVO>();
View Full Code Here

        if(this.repositoryId == null)
            this.repositoryId = this.contentVO.getRepositoryId();
               
        if(this.contentVO.getRepositoryId() != null && !hasAccessTo("Repository.Read", "" + this.contentVO.getRepositoryId()) && !hasAccessTo("Repository.Write", "" + this.contentVO.getRepositoryId()))
        {
        AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
        ceb.add(new AccessConstraintException("Content.contentId", "1000"));
        ceb.throwIfNotEmpty();
        }

        if(this.getIsBranch().booleanValue())
    {
           this.defaultFolderContentTypeName = InfoGlueSettingsController.getInfoGlueSettingsController().getProperty("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName", "applicationProperties", null, false, false, false, false, null);
View Full Code Here

          ContentVO contentVO = ContentControllerProxy.getController().getACContentVOWithId(this.getInfoGluePrincipal(), getContentId());
         
          if(contentVO.getRepositoryId() != null && !hasAccessTo("Repository.Read", "" + contentVO.getRepositoryId()) && !hasAccessTo("Repository.Write", "" + this.contentVO.getRepositoryId()))
          {
            logger.error("The user " + this.getInfoGluePrincipal().getName() + " had no access to Repository.Read or Repository.write and " + this.contentVO.getRepositoryId() + ". Could be an hacker attempt.");
          AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
          ceb.add(new AccessConstraintException("Content.contentId", "1000"));
          ceb.throwIfNotEmpty();
          }

          if((this.stay == null || !this.stay.equalsIgnoreCase("true")) && contentVO.getIsBranch().booleanValue() == false && contentVO.getContentTypeDefinitionId() != null && getShowContentVersionFirst().equalsIgnoreCase("true"))
          {
              if(this.repositoryId == null)
View Full Code Here

          ContentVO contentVO = ContentControllerProxy.getController().getACContentVOWithId(this.getInfoGluePrincipal(), getContentId());
         
          if(contentVO.getRepositoryId() != null && !hasAccessTo("Repository.Read", "" + contentVO.getRepositoryId())  && !hasAccessTo("Repository.Write", "" + this.contentVO.getRepositoryId()))
          {
            logger.error("The user " + this.getInfoGluePrincipal().getName() + " had no access to Repository.Read or Repository.write and " + this.contentVO.getRepositoryId() + ". Could be an hacker attempt.");
          AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
          ceb.add(new AccessConstraintException("Content.contentId", "1000"));
          ceb.throwIfNotEmpty();
          }

          if((this.stay == null || !this.stay.equalsIgnoreCase("true")) && contentVO.getIsBranch().booleanValue() == false && contentVO.getContentTypeDefinitionId() != null && getShowContentVersionFirst().equalsIgnoreCase("true"))
          {
              if(this.repositoryId == null)
View Full Code Here

        contentVersionVO.setVersionModifier(this.getInfoGluePrincipal().getName());
        contentVersionVO.setVersionValue(sb.toString());
        this.contentVersionVO = ContentVersionController.getContentVersionController().create(contentId, languageId, contentVersionVO, null);
      }

      AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
     
      Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(this.contentVersionVO.getContentId());
      logger.info("protectedContentId:" + protectedContentId);
      if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.Write", protectedContentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1001"));
     
      ceb.throwIfNotEmpty();
     
      String attributeValue = "";
      if(this.contentVersionVO != null)
      {
        attributeValue = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionVO, attributeName, false);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.AccessConstraintExceptionBuffer

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.