if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
{
String versionModifier = contentVersionVO.getVersionModifier();
if(versionModifier != null)
{
InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
if(versionModifierPrincipal != null)
{
boolean hasGroup = false;
List groups = versionModifierPrincipal.getGroups();
Iterator groupsIterator = groups.iterator();
while(groupsIterator.hasNext())
{
InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
if(principal.getGroups().contains(group))
hasGroup = true;
}
if(!hasGroup)
isValid = false;
}
}
}
else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
{
String versionModifier = contentVersionVO.getVersionModifier();
if(versionModifier != null)
{
InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
if(versionModifierPrincipal != null)
{
boolean hasGroup = false;
String groupName = filter.substring(filter.indexOf("_") + 1);
List groups = versionModifierPrincipal.getGroups();
Iterator groupsIterator = groups.iterator();
while(groupsIterator.hasNext())
{
InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
if(groupName.equalsIgnoreCase(group.getName()))
hasGroup = true;
}
if(!hasGroup)
isValid = false;
}
}
}
}
}
else if(event.getEntityClass().equalsIgnoreCase(SiteNodeVersion.class.getName()))
{
SiteNodeVersionVO siteNodeVersion = null;
SiteNodeVO siteNode = null;
try
{
siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
//siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithIdAsReadOnly(event.getEntityId(), db);
if(siteNodeVersion.getSiteNodeId() != null)
siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
}
catch(SystemException e)
{
hasBrokenItems = true;
throw e;
}
if(siteNodeVersion == null || siteNode == null)
{
hasBrokenItems = true;
isValid = false;
}
else
{
if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
{
String versionModifier = siteNodeVersion.getVersionModifier();
if(versionModifier != null)
{
InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
if(versionModifierPrincipal != null)
{
boolean hasGroup = false;
List groups = versionModifierPrincipal.getGroups();
Iterator groupsIterator = groups.iterator();
while(groupsIterator.hasNext())
{
InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
if(principal.getGroups().contains(group))
hasGroup = true;
}
if(!hasGroup)
isValid = false;
}
}
}
else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
{
String versionModifier = siteNodeVersion.getVersionModifier();
if(versionModifier != null)
{
InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
if(versionModifierPrincipal != null)
{
boolean hasGroup = false;
String groupName = filter.substring(filter.indexOf("_") + 1);
List groups = versionModifierPrincipal.getGroups();
Iterator groupsIterator = groups.iterator();
while(groupsIterator.hasNext())
{
InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
if(groupName.equalsIgnoreCase(group.getName()))