content.setIsProtected(ContentVO.YES);
}
else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
{
Integer siteNodeVersionId = new Integer(parameters);
SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
if(logger.isDebugEnabled())
logger.debug("It was a siteNodeVersion and there are access rights - set it to true:" + accessRights);
if(!siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES) && !siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES_WITH_INHERIT_FALLBACK))
siteNodeVersion.setIsProtected(SiteNodeVersionVO.YES);
}
}
else
{
List accessRightsUsers = getAccessRightsUsers(interceptionPointCategory, parameters, db, true);
if(logger.isDebugEnabled())
logger.debug("accessRightsUsers:" + accessRightsUsers.size());
if(accessRightsUsers == null || accessRightsUsers.size() == 0)
{
if(interceptionPointCategory.equalsIgnoreCase("Content"))
{
Integer contentId = new Integer(parameters);
Content content = ContentControllerProxy.getController().getContentWithId(contentId, db);
if(content.getIsProtected().equals(ContentVO.YES))
content.setIsProtected(ContentVO.NO);
}
else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
{
Integer siteNodeVersionId = new Integer(parameters);
SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
if(logger.isDebugEnabled())
logger.debug("It was a siteNodeVersion and there was no access rights - set it to false:" + accessRights + ":" + siteNodeVersion.getIsProtected());
if(siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES) && !siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES_WITH_INHERIT_FALLBACK))
{
siteNodeVersion.setIsProtected(SiteNodeVersionVO.NO);
siteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
}
}
}
}