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") ||