Examples of InterceptionPointVO


Examples of org.infoglue.cms.entities.management.InterceptionPointVO

      intercept(hashMap, InterceptionPointName, infogluePrincipal, true, false);
  }

    protected void intercept(Map hashMap, String InterceptionPointName, InfoGluePrincipal infogluePrincipal, boolean allowCreatorAccess, boolean ignoreMissingInterceptionPoint) throws ConstraintException, SystemException, Bug, Exception
  {
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(InterceptionPointName);
     
    if(interceptionPointVO == null)
    {
      if(ignoreMissingInterceptionPoint)
        return;
      else
        throw new SystemException("The InterceptionPoint " + InterceptionPointName + " was not found. The system will not work unless you restore it.");
    }
   
    List interceptors = InterceptorController.getController().getInterceptorsVOList(interceptionPointVO.getInterceptionPointId());
    Iterator interceptorsIterator = interceptors.iterator();
    while(interceptorsIterator.hasNext())
    {
      InterceptorVO interceptorVO = (InterceptorVO)interceptorsIterator.next();
      logger.info("Adding interceptorVO:" + interceptorVO.getName());
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

  }
   
    Map<String,InfoGlueInterceptor> cachedInterceptors = new HashMap<String,InfoGlueInterceptor>();
    protected void intercept(Map hashMap, String InterceptionPointName, InfoGluePrincipal infogluePrincipal, boolean allowCreatorAccess) throws ConstraintException, SystemException, Bug, Exception
  {
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(InterceptionPointName);
     
    if(interceptionPointVO == null)
      throw new SystemException("The InterceptionPoint " + InterceptionPointName + " was not found. The system will not work unless you restore it.");

    List interceptors = InterceptionPointController.getController().getInterceptorsVOList(interceptionPointVO.getInterceptionPointId());
   
    Iterator interceptorsIterator = interceptors.iterator();
    while(interceptorsIterator.hasNext())
    {
      InterceptorVO interceptorVO = (InterceptorVO)interceptorsIterator.next();
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

     * @throws Exception
     */

    protected void intercept(Map hashMap, String InterceptionPointName, InfoGluePrincipal infogluePrincipal, Database db) throws ConstraintException, SystemException, Bug, Exception
  {
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(InterceptionPointName, db);
     
    if(interceptionPointVO == null)
      throw new SystemException("The InterceptionPoint " + InterceptionPointName + " was not found. The system will not work unless you restore it.");

    List interceptors = InterceptionPointController.getController().getInterceptorsVOList(interceptionPointVO.getInterceptionPointId(), db);
    Iterator interceptorsIterator = interceptors.iterator();
    while(interceptorsIterator.hasNext())
    {
      InterceptorVO interceptorVO = (InterceptorVO)interceptorsIterator.next();
      logger.info("Adding interceptorVO:" + interceptorVO.getName());
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

  }

    protected void intercept(Map hashMap, String InterceptionPointName, InfoGluePrincipal infogluePrincipal, boolean allowCreatorAccess, Database db) throws ConstraintException, SystemException, Bug, Exception
  {
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(InterceptionPointName, db);
     
    if(interceptionPointVO == null)
      throw new SystemException("The InterceptionPoint " + InterceptionPointName + " was not found. The system will not work unless you restore it.");

    List interceptors = InterceptionPointController.getController().getInterceptorsVOList(interceptionPointVO.getInterceptionPointId(), db);
    Iterator interceptorsIterator = interceptors.iterator();
    while(interceptorsIterator.hasNext())
    {
      InterceptorVO interceptorVO = (InterceptorVO)interceptorsIterator.next();
      logger.info("Adding interceptorVO:" + interceptorVO.getName());
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

  public void repairBrokenProtection(Database db) throws SystemException, Bug
  {
    if(this.siteNodeVersionVO != null && this.siteNodeVersionVO.getIsProtected().intValue() == 1)
    {
      InterceptionPointVO ipReadVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.Read", db);
      InterceptionPointVO ipWriteVO = InterceptionPointController.getController().getInterceptionPointVOWithName("SiteNodeVersion.Write", db);
      if(ipReadVO != null && ipWriteVO != null)
      {
        List accessRightListRead = AccessRightController.getController().getAccessRightListOnlyReadOnly(ipReadVO.getId(), "" + this.siteNodeVersionVO.getId(), db);
        List accessRightListWrite = AccessRightController.getController().getAccessRightListOnlyReadOnly(ipWriteVO.getId(), "" + this.siteNodeVersionVO.getId(), db);
        if((accessRightListRead == null || accessRightListRead.size() == 0) && (accessRightListWrite == null || accessRightListWrite.size() == 0))
        {
          SiteNodeVersion sn = SiteNodeVersionController.getController().getSiteNodeVersionWithId(this.siteNodeVersionVO.getId(), db);
          if(sn != null)
            sn.setIsProtected(SiteNodeVersionVO.INHERITED);
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

  public List getAccessRightVOListOnly(Database db, Integer interceptionPointId, String parameters) throws SystemException, Bug
  {
    List accessRightVOList = null;
   
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithId(interceptionPointId);
    if(interceptionPointVO.getUsesExtraDataForAccessControl().booleanValue())
      accessRightVOList = toVOList(getAccessRightListOnlyReadOnly(interceptionPointId, parameters, db));
    else
      accessRightVOList = toVOList(getAccessRightList(interceptionPointId, db));

    logger.info("accessRightVOList:" + accessRightVOList.size());
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

    {
      logger.info("roles:" + roles.size());
      logger.info("groups:" + groups.size());
    }
   
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(interceptionPointName, db);
    if(interceptionPointVO == null)
    {
      //logger.info("interceptionPointVO null");
      return true;
    }
   
    //ComponentEditor.%' OR name = 'Component.Select' OR name = 'ComponentPropertyEditor.EditProperty' OR name like '%.Read' AND name NOT LIKE 'SiteNodeVersion.Read
    if((interceptionPointName.indexOf("ComponentEditor.") > -1 || interceptionPointName.indexOf("Component.Select") > -1 || interceptionPointName.indexOf("ComponentPropertyEditor.EditProperty") > -1 || interceptionPointName.indexOf(".Read") > -1) && interceptionPointName.indexOf("SiteNodeVersion.Read") == -1)
    {
      //Map<String,Integer> userAccessRightsMap = (Map<String,Integer>)CacheController.getCachedObjectFromAdvancedCache("personalAuthorizationCache", "authorizationMap_" + infoGluePrincipal.getName());
      Map<String,Integer> userAccessRightsMap = (Map<String,Integer>)CacheController.getCachedObject("userAccessCache", "authorizationMap_" + infoGluePrincipal.getName());
      //Map<String,Integer> userAccessRightsMap = principalAccessRights.get("" + infoGluePrincipal.getName());
      if(userAccessRightsMap != null)
      {
        String acKey = "" + interceptionPointVO.getId();
        if(extraParameters != null && !extraParameters.equals(""))
          acKey = "" + interceptionPointVO.getId() + "_" + extraParameters;
        //logger.info("Checking access on: " + acKey);
       
        Integer hasAccess = userAccessRightsMap.get(acKey);
        //if(acKey.indexOf("RightColumnOne") > -1)
        //  logger.info("hasAccess:" + hasAccess + " on " + acKey);
       
        if(hasAccess == null)
        {
          if(returnTrueIfNoAccessRightsDefined /*&& (interceptionPointName.indexOf("ContentVersion.") > -1 || )*/)
            logger.info("Double checking on access as it's a content version and those are often not protected:" + acKey);
          else
          {
              CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(false), new String[]{infoGluePrincipal.getName()}, true);
            return false;
          }
        }
        else if(hasAccess == 1)
        {
            CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(true), new String[]{infoGluePrincipal.getName()}, true);
          return true;
        }
        else if(hasAccess == -1)
        {
          logger.info("Unknown access to " + acKey + " - probably a duplicate access right on it:" + acKey);
        }
      }
    }
   
    logger.info("Reading the hard way:" + interceptionPointVO.getId() + ":" + extraParameters);
   
    List<AccessRight> accessRightList = this.getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), extraParameters, db);
    if(logger.isInfoEnabled())
      logger.info("accessRightList:" + accessRightList.size());
   
    boolean accessRightEmpty = true;
    if(accessRightList != null)
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

    {
      logger.info("roles:" + roles.size());
      logger.info("groups:" + groups.size());
    }
   
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(interceptionPointName, db);
    if(interceptionPointVO == null)
      return true;

    List<AccessRightUserVO> accessRightUserVOList = this.getAccessRightUserVOList(interceptionPointVO.getId(), extraParameters, db);
   
    //If no access rights are set for the content version we should assume it was not protected on version level.
    if(interceptionPointName.equalsIgnoreCase("ContentVersion.Read") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Write") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Delete") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Publish"))
    {
      return true;
    }

    for(AccessRightUserVO accessRightUserVO : accessRightUserVOList)
    {
        if(accessRightUserVO.getUserName().equals(infoGluePrincipal.getName()))
        {
            isPrincipalAuthorized = true;
        }
    }

    if(!isPrincipalAuthorized)
    {
      List<AccessRightRoleVO> accessRightRoleVOList = this.getAccessRightRoleVOList(interceptionPointVO.getId(), extraParameters, db);
      List<AccessRightGroupVO> accessRightGroupVOList = this.getAccessRightGroupVOList(interceptionPointVO.getId(), extraParameters, db);
     
      if(returnTrueIfNoAccessRightsDefined && ((accessRightUserVOList == null || accessRightUserVOList.size() == 0) && (accessRightRoleVOList == null || accessRightRoleVOList.size() == 0) && (accessRightGroupVOList == null || accessRightGroupVOList.size() == 0)))
        return true;
              
      Iterator rolesIterator = roles.iterator();
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

    boolean principalHasRole = false;
    boolean principalHasGroup = false;
      
    Collection roles = infoGluePrincipal.getRoles();
    Collection groups = infoGluePrincipal.getGroups();
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(interceptionPointName, db);
    if(interceptionPointVO == null && returnSuccessIfInterceptionPointNotDefined)
    {
        CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(true), new String[]{infoGluePrincipal.getName()}, true);
        return true;
    }
   
    if(interceptionPointVO == null && returnFailureIfInterceptionPointNotDefined)
    {
        CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(false), new String[]{infoGluePrincipal.getName()}, true);
      return false;
    }
   
    if(interceptionPointVO == null)
      return true;
     
    //if(interceptionPointName.indexOf(".Read") > -1 && interceptionPointName.indexOf("SiteNodeVersion.Read") == -1)
    if((interceptionPointName.indexOf("ComponentEditor.") > -1 || interceptionPointName.indexOf("Component.Select") > -1 || interceptionPointName.indexOf("ComponentPropertyEditor.EditProperty") > -1 || interceptionPointName.indexOf(".Read") > -1) && interceptionPointName.indexOf("SiteNodeVersion.Read") == -1)
    {
      Map<String,Integer> userAccessRightsMap = (Map<String,Integer>)CacheController.getCachedObject("userAccessCache", "authorizationMap_" + infoGluePrincipal.getName());
      //Map<String,Integer> userAccessRightsMap = (Map<String,Integer>)CacheController.getCachedObjectFromAdvancedCache("personalAuthorizationCache", "authorizationMap_" + infoGluePrincipal.getName());
      if(userAccessRightsMap != null)
      {
        String acKey = "" + interceptionPointVO.getId();
        //logger.info("Checking access on: " + acKey);
        Integer hasAccess = userAccessRightsMap.get(acKey);
        if(hasAccess == null)
        {
          CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(false), new String[]{infoGluePrincipal.getName()}, true);
          return false;
        }
        else if(hasAccess == 1)
        {
          CacheController.cacheObjectInAdvancedCache("personalAuthorizationCache", key, new Boolean(true), new String[]{infoGluePrincipal.getName()}, true);
          return true;
        }
        else if(hasAccess == -1)
        {
          logger.info("Unknown access to " + acKey + " - probably a duplicate access right on it:" + acKey);
        }
      }
    }
   
    logger.info("Reading the hard way: " + interceptionPointVO.getName());

    //List accessRightList = this.getAccessRightList(interceptionPointVO.getId(), db);
    List accessRightList = this.getAccessRightListOnlyReadOnly(interceptionPointVO.getId(), db);
    if(logger.isInfoEnabled())
      logger.info("accessRightList:" + accessRightList.size());
    //If no access rights are set for the content version we should assume it was not protected on version level.
    if((interceptionPointName.equalsIgnoreCase("ContentVersion.Read") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Write") ||
View Full Code Here

Examples of org.infoglue.cms.entities.management.InterceptionPointVO

    boolean principalHasRole = false;
    boolean principalHasGroup = false;
      
    Collection roles = infoGluePrincipal.getRoles();
    Collection groups = infoGluePrincipal.getGroups();
    InterceptionPointVO interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithName(interceptionPointName, db);
    //InterceptionPoint interceptionPoint = InterceptionPointController.getController().getInterceptionPointWithName(interceptionPointName, db);
    if(interceptionPointVO == null && returnSuccessIfInterceptionPointNotDefined)
      return true;
   
    if(interceptionPointVO == null && returnFailureIfInterceptionPointNotDefined)
      return false;
   
    if(interceptionPointVO == null)
      return true;
     
    List<AccessRightUserVO> accessRightUserVOList = this.getAccessRightUserVOList(interceptionPointVO.getId(), null, db);
   
    //If no access rights are set for the content version we should assume it was not protected on version level.
    if(interceptionPointName.equalsIgnoreCase("ContentVersion.Read") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Write") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Delete") ||
       interceptionPointName.equalsIgnoreCase("ContentVersion.Publish"))
    {
      return true;
    }

    for(AccessRightUserVO accessRightUserVO : accessRightUserVOList)
    {
        if(accessRightUserVO.getUserName().equals(infoGluePrincipal.getName()))
        {
            isPrincipalAuthorized = true;
        }
    }
   
    if(!isPrincipalAuthorized)
    {
      List<AccessRightRoleVO> accessRightRoleVOList = this.getAccessRightRoleVOList(interceptionPointVO.getId(), null, db);
      List<AccessRightGroupVO> accessRightGroupVOList = this.getAccessRightGroupVOList(interceptionPointVO.getId(), null, db);
     
      if(returnTrueIfNoAccessRightsDefined && ((accessRightUserVOList == null || accessRightUserVOList.size() == 0) && (accessRightRoleVOList == null || accessRightRoleVOList.size() == 0) && (accessRightGroupVOList == null || accessRightGroupVOList.size() == 0)))
        return true;
              
      Iterator rolesIterator = roles.iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.