Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.AccessConstraintExceptionBuffer


                  String interceptionPointName     = (String)accessRightMap.get("interceptionPointName");
                  String interceptionPointCategory   = interceptionPointName.substring(0, interceptionPointName.indexOf("."));
                  String parameters           = (String)accessRightMap.get("parameters");
                  String clearOldAccessRights     = (String)accessRightMap.get("clearOldAccessRights");
                 
              AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
             
              if(interceptionPointCategory.equalsIgnoreCase("Content"))
              { 
                Integer contentId = new Integer(parameters);
                ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
                if(!contentVO.getCreatorName().equalsIgnoreCase(principal.getName()))
                {
                  Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
                  if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(principal, "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(!siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(principal.getName()))
                {
                  Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
                  if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(principal, "SiteNodeVersion.ChangeAccessRights", siteNodeVersionId.toString()))
                    ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1006"));
                }
              }
              else
              {
                ceb.add(new AccessConstraintException("Repository.repositoryId", "1006"));
              }
             
              ceb.throwIfNotEmpty();

                 
                  Database db = CastorDatabaseService.getDatabase();
            beginTransaction(db);
           
View Full Code Here


      if(contentId != null)
      {
          this.contentVO = ContentControllerProxy.getController().getACContentVOWithId(this.getInfoGluePrincipal(), contentId);
          if(this.contentVO.getRepositoryId() != null && checkPermission && !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();
          }
      }
     
      logger.info("this.contentVO:" + this.contentVO);
      logger.info("this.contentVO.getParentContentId():" + this.contentVO.getParentContentId());
View Full Code Here

    if(parentContentId == null)
    {
      return "stateLocation";
    }
   
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
 
    Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(parentContentId);
    if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.Create", protectedContentId.toString()))
      ceb.add(new AccessConstraintException("Content.contentId", "1002"));

    //if(ContentControllerProxy.getController().getIsContentProtected(parentContentId) && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.Create", parentContentId.toString()))
    //  ceb.add(new AccessConstraintException("Content.contentId", "1002"));

    ceb.throwIfNotEmpty();

    if(allowedContentTypeDefinitionId == null)
    {
      this.contentTypeDefinitionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList();
    }
View Full Code Here

  public void intercept(InfoGluePrincipal infoGluePrincipal, InterceptionPointVO interceptionPointVO, Map extradata, boolean allowCreatorAccess) throws ConstraintException, SystemException, Exception
  {
    logger.info("interceptionPointVO:" + interceptionPointVO.getName());
   
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    if(interceptionPointVO.getName().equalsIgnoreCase("Content.Read"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(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);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = contentId; //ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(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");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Write", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1001"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Create"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Create", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1002"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Delete"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Delete", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1003"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.Move"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Move", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1004"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.CreateVersion"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      if(contentId != null)
      {
        ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
        if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
        {
          Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
          if(ContentVersionControllerProxy.getController().getIsContentProtected(contentId, true) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.CreateVersion", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "1002"));
        }
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.SubmitToPublish"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.SubmitToPublish", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1005"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("Content.ChangeAccessRights"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
      if(!allowCreatorAccess || !contentVO.getCreatorName().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.ChangeAccessRights", protectedContentId.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(), false) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Read", contentVersionId.toString()))
        {
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1000"));
        }
        else
        {
          Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentVersionVO.getContentId());
          if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Read", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "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(), false) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Write", contentVersionId.toString()))
        {
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1001"));
        }
        else
        {
          Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentVersionVO.getContentId());
          if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "Content.Write", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "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(), false) && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "ContentVersion.Delete", contentVersionId.toString()))
          ceb.add(new AccessConstraintException("ContentVersion.contentVersionId", "1003"));
      }
    }
    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()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(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);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.Write", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1001"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.CreateSiteNode"))
    {
      Integer parentSiteNodeId = (Integer)extradata.get("siteNodeId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(parentSiteNodeId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionVO.getId());
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.CreateSiteNode", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1002"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.DeleteSiteNode"))
    {
      Integer siteNodeId = (Integer)extradata.get("siteNodeId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(siteNodeId);
      if(!allowCreatorAccess || (siteNodeVersionVO != null && !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName())))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionVO.getId());
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.DeleteSiteNode", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1003"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.MoveSiteNode"))
    {
      Integer siteNodeId = (Integer)extradata.get("siteNodeId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(siteNodeId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionVO.getId());
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.MoveSiteNode", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1004"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.SubmitToPublish"))
    {
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.SubmitToPublish", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1005"));
      }
    }
    else if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.ChangeAccessRights"))
    {
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(siteNodeVersionId);
      if(!allowCreatorAccess || !siteNodeVersionVO.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(infoGluePrincipal, "SiteNodeVersion.ChangeAccessRights", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeId", "1006"));
      }
    }
   
    ceb.throwIfNotEmpty();
  }
View Full Code Here

  public void intercept(InfoGluePrincipal infoGluePrincipal, InterceptionPointVO interceptionPointVO, Map extradata, boolean allowCreatorAccess, Database db) throws ConstraintException, SystemException, Exception
  {
    logger.info("interceptionPointVO:" + interceptionPointVO.getName());
   
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    if(interceptionPointVO.getName().equalsIgnoreCase("Content.Read"))
    {
      Integer contentId = (Integer)extradata.get("contentId");
      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

    if(this.contentId != null)
    {
        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();

      contentVersionVOList = ContentVersionController.getContentVersionController().getContentVersionVOWithParentRecursive(contentId, ContentVersionVO.PUBLISHED_STATE, false);
    }

      return "input";
View Full Code Here

      if(this.contentId != null)
      {
          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();
 
        processBean.updateProcess("Getting child contents available for unpublish");
       
        contentVOList = ContentController.getContentController().getContentVOWithParentRecursive(contentId, processBean);
      }
View Full Code Here

    return "treeView";
  }

    public String doInput() throws Exception
    {
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(parentContentId);
    if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.Create", protectedContentId.toString()))
      ceb.add(new AccessConstraintException("Content.contentId", "1002"));
   
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

    if(this.getIsBranch().booleanValue())
    {
        this.defaultFolderContentTypeName = ps.getString("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName");
        if(this.defaultFolderContentTypeName == null || this.defaultFolderContentTypeName.equals(""))
          this.defaultFolderContentTypeName = "Folder";
    }
    else
    {
        this.defaultContentTypeName = ps.getString("content_" + this.parentContentId + "_defaultContentTypeName");
    }
        if ( ps.exists( "content_" + this.parentContentId + "_allowedContentTypeNames" ) )
        {
            this.allowedContentTypeNames = ps.getString("content_" + this.parentContentId + "_allowedContentTypeNames");
        }
    ceb.throwIfNotEmpty();
   
    return "input";
    }
View Full Code Here

    return "input";
    }

    public String doInputV3() throws Exception
    {
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
   
    Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(parentContentId);
    if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.Create", protectedContentId.toString()))
      ceb.add(new AccessConstraintException("Content.contentId", "1002"));
   
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
      PropertySet ps = PropertySetManager.getInstance("jdbc", args);

      this.defaultFolderContentTypeName = ps.getString("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName");
      if(this.defaultFolderContentTypeName == null || this.defaultFolderContentTypeName.equals(""))
      {
        this.defaultFolderContentTypeName = "Folder";
      }
     
    this.defaultContentTypeName = ps.getString("content_" + this.parentContentId + "_defaultContentTypeName");
   
    if (ps.exists("content_" + this.parentContentId + "_allowedContentTypeNames"))
        {
            this.allowedContentTypeNames = ps.getString("content_" + this.parentContentId + "_allowedContentTypeNames");
        }
   
        userSessionKey = "" + System.currentTimeMillis();

    parentContentVO = ContentControllerProxy.getController().getContentVOWithId(parentContentId);

    String createContentInlineOperationDoneHeader = getLocalizedString(getLocale(), "tool.contenttool.createContentInlineOperationDoneHeader", parentContentVO.getName());
    String createContentInlineOperationBackToCurrentContentLinkText = getLocalizedString(getLocale(), "tool.contenttool.createContentInlineOperationBackToCurrentContentText");
    String createContentInlineOperationBackToCurrentContentTitleText = getLocalizedString(getLocale(), "tool.contenttool.createContentInlineOperationBackToCurrentContentTitleText");

      setActionMessage(userSessionKey, createContentInlineOperationDoneHeader);
      addActionLink(userSessionKey, new LinkBean("currentContentUrl", createContentInlineOperationBackToCurrentContentLinkText, createContentInlineOperationBackToCurrentContentTitleText, createContentInlineOperationBackToCurrentContentTitleText, this.originalAddress, false, ""));

    ceb.throwIfNotEmpty();
   
    return "inputV3";
    }
View Full Code Here

              this.siteNodeVersionId = siteNodeVersionVO.getId();
      }
     
      if(this.siteNodeVersionId != null)
      {
        AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
     
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "SiteNodeVersion.SubmitToPublish", protectedSiteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1005"));
   
        ceb.throwIfNotEmpty();
 
        if(contentId != null && contentId > -1)
        {
          Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
          if(protectedContentId == null || AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.SubmitToPublish", protectedContentId.toString()))
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.