Package org.infoglue.cms.exception

Examples of org.infoglue.cms.exception.AccessConstraintException


      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId, db);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId, db);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Content.Read", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1000"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Component.Select"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId, db);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = contentId; //ContentControllerProxy.getController().getProtectedContentId(contentId, db);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Component.Select", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1000"));
      }
    }
   
    /*
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Write"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Write", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1001"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Create"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Create", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1002"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Delete"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Delete", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1003"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Move"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Move", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1004"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.SubmitToPublish"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.SubmitToPublish", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1005"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.ChangeAccessRights"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.ChangeAccessRights", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1006"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("ContentVersion.Read"))
    {
      Integer contentVersionId = (Integer)extradata.get("contentVersionId");
      ContentVersionVO contentVersionVO = ContentVersionControllerProxy.getController().getContentVersionVOWithId(contentVersionId);
      if(!allowCreatorAccess || !contentVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      { 
        if(ContentVersionControllerProxy.getController().getIsContentProtected(contentVersionVO.getContentId()) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Read", contentVersionId.toString()))
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1000"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("ContentVersion.Write"))
    {
      Integer contentVersionId = (Integer)extradata.get("contentVersionId");
      ContentVersionVO contentVersionVO = ContentVersionControllerProxy.getController().getContentVersionVOWithId(contentVersionId);
      if(!allowCreatorAccess || !contentVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      { 
        if(ContentVersionControllerProxy.getController().getIsContentProtected(contentVersionVO.getContentId()) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Write", contentVersionId.toString()))
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1001"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("ContentVersion.Delete"))
    {
      Integer contentVersionId = (Integer)extradata.get("contentVersionId");
      ContentVersionVO contentVersionVO = ContentVersionControllerProxy.getController().getContentVersionVOWithId(contentVersionId);
      if(!allowCreatorAccess || !contentVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      { 
        if(ContentVersionControllerProxy.getController().getIsContentProtected(contentVersionVO.getContentId()) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Delete", contentVersionId.toString()))
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1003"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.CreateVersion"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(ContentVersionControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.CreateVersion", contentId.toString()))
        ceb.add(new AccessConstraintException("Content.contentId", "1002"));
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.Read"))
    {
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        if(SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getIsSiteNodeVersionProtected(siteNodeVersionId) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.Read", siteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1000"));
      }
    }
    else*/ if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.CreateSiteNode"))
    {
      Integer parentSiteNodeId = (Integer)extradata.get("siteNodeId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(db, parentSiteNodeId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionVO.getId(), db);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "SiteNodeVersion.CreateSiteNode", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1002"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.Read"))
    {
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId, db);
      //SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId, db);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "SiteNodeVersion.Read", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1000"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.Write"))
    {
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId, db);
      //SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId, db);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "SiteNodeVersion.Write", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1001"));
      }
    }

    ceb.throwIfNotEmpty();
  }
View Full Code Here


          List changeAccessRightVOList = AccessRightController.getController().getAccessRightVOListOnly(changeInterceptionPointVO.getId(), "" + contentId);
          List readAccessRightVOList = AccessRightController.getController().getAccessRightVOListOnly(readInterceptionPointVO.getId(), "" + contentId);
          logger.info("changeAccessRightVOList:" + changeAccessRightVOList.size());
          logger.info("readAccessRightVOList:" + readAccessRightVOList.size());
          if(changeAccessRightVOList.size() > 0 && readAccessRightVOList.size() > 0)
            ceb.add(new AccessConstraintException("Content.contentId", "1006"));
        }
      }
    }
    else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
    { 
      if(extraParameters == null || extraParameters.equals(""))
          throw new SystemException("The sitenode category must have a sitenode id sent in so don't set 'Use extra data for access control' to no for those interception points.");

      Integer siteNodeVersionId = new Integer(extraParameters);
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId);
      SiteNodeVersionVO latestSiteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(siteNodeVersionVO.getSiteNodeId());
      if(latestSiteNodeVersionVO.getId().intValue() > siteNodeVersionVO.getId().intValue() && (getRequest().getParameter("forceVersion") == null || getRequest().getParameter("forceVersion").equals("")))
      {
        siteNodeVersionId = latestSiteNodeVersionVO.getId();
        siteNodeVersionVO = latestSiteNodeVersionVO;
        extraParameters = siteNodeVersionId.toString();
      }
      if(siteNodeVersionVO != null)
        unrefreshedNodeId = "" + siteNodeVersionVO.getSiteNodeId();
     
      if(!siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(this.getInfoGluePrincipal().getName()))
      {
        boolean isSiteNodeVersionProtected = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getIsSiteNodeVersionProtected(siteNodeVersionVO.getId());
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "SiteNodeVersion.ChangeAccessRights", siteNodeVersionId.toString()))
        {
          InterceptionPointVO changeInterceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.ChangeAccessRights");
          InterceptionPointVO readInterceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.Read");
          List changeAccessRightVOList = AccessRightController.getController().getAccessRightVOListOnly(changeInterceptionPointVO.getId(), "" + siteNodeVersionVO.getId());
          List readAccessRightVOList = AccessRightController.getController().getAccessRightVOListOnly(readInterceptionPointVO.getId(), "" + siteNodeVersionVO.getId());
          logger.info("changeAccessRightVOList:" + changeAccessRightVOList.size());
          logger.info("readAccessRightVOList:" + readAccessRightVOList.size());
          if(changeAccessRightVOList.size() > 0 && readAccessRightVOList.size() > 0)
            ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1006"));
        }
      }
    }

    this.interceptionPointVOList = InterceptionPointController.getController().getInterceptionPointVOList(interceptionPointCategory);
View Full Code Here

        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;
          List events = new ArrayList();
          siteNodeVersionVO = SiteNodeStateController.getController().changeState(siteNodeVersionVO.getId(), SiteNodeVersionVO.WORKING_STATE, "Access right changes", true, this.getInfoGluePrincipal(), siteNodeVersionVO.getSiteNodeId(), events);
          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", protectedSiteNodeVersionId.toString()))
            ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1006"));
        }
      }
      ceb.throwIfNotEmpty();
    }
   
View Full Code Here

      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.intValue())
      {
        this.oldParameters = "" + siteNodeVersionId;
        List events = new ArrayList();
        siteNodeVersionVO = SiteNodeStateController.getController().changeState(siteNodeVersionVO.getId(), SiteNodeVersionVO.WORKING_STATE, "Access right changes", true, this.getInfoGluePrincipal(), siteNodeVersionVO.getSiteNodeId(), events);
        this.newParameters = "" + siteNodeVersionVO.getId();
        this.parameters = "" + siteNodeVersionVO.getId();
        siteNodeVersionId = siteNodeVersionVO.getId();
     
        AccessRightVO accessRightVO = AccessRightController.getController().getAccessRightVOWithId(this.accessRightId);
        List<AccessRightVO> accessRightsVOList = AccessRightController.getController().getAccessRightVOList(accessRightVO.getInterceptionPointName(), newParameters);
        for(AccessRightVO accessRightVOCandidate : accessRightsVOList)
        {
          if(accessRightVOCandidate.getInterceptionPointId().intValue() == interceptionPointId.intValue())
          {
            this.accessRightId = accessRightVOCandidate.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();
   
View Full Code Here

        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();
    }
View Full Code Here

        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();
    }
View Full Code Here

   
    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
View Full Code Here

         
        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());
       
View Full Code Here

            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())
    {
View Full Code Here

         
          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"))
          {
View Full Code Here

TOP

Related Classes of org.infoglue.cms.exception.AccessConstraintException

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.