dstConstraint.setPermissions(srcConstraint.getPermissions());
}
protected SecurityConstraints copySecurityConstraints(String type, SecurityConstraints source)
{
SecurityConstraints security = newSecurityConstraints();
if (source.getOwner() != null)
{
security.setOwner(source.getOwner());
}
if (source.getSecurityConstraints() != null)
{
List copiedConstraints = DatabasePageManagerUtils.createList();
Iterator constraints = source.getSecurityConstraints().iterator();
while (constraints.hasNext())
{
SecurityConstraint srcConstraint = (SecurityConstraint)constraints.next();
SecurityConstraint dstConstraint = null;
if (type.equals(PAGE_NODE_TYPE))
{
dstConstraint = newPageSecurityConstraint();
}
else if (type.equals(FOLDER_NODE_TYPE))
{
dstConstraint = newFolderSecurityConstraint();
}
else if (type.equals(LINK_NODE_TYPE))
{
dstConstraint = newLinkSecurityConstraint();
}
else if (type.equals(FRAGMENT_NODE_TYPE))
{
dstConstraint = newFragmentSecurityConstraint();
}
copyConstraint(srcConstraint, dstConstraint);
copiedConstraints.add(dstConstraint);
}
security.setSecurityConstraints(copiedConstraints);
}
if (source.getSecurityConstraintsRefs() != null)
{
List copiedRefs = DatabasePageManagerUtils.createList();
Iterator refs = source.getSecurityConstraintsRefs().iterator();
while (refs.hasNext())
{
String constraintsRef = (String)refs.next();
copiedRefs.add(constraintsRef);
}
security.setSecurityConstraintsRefs(copiedRefs);
}
return security;
}