- Fix AR-442 Error performing background import of several .acp files - ConcurrentModificationException

- Support Import of ACP files that have Guest permission reference (re-map to Consumer)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-02-21 19:29:42 +00:00
parent 19a02b56b4
commit 4e46906b91
2 changed files with 11 additions and 2 deletions

View File

@@ -1181,14 +1181,16 @@ public class ImporterComponent
// Create initial node (but, first disable behaviour for the node to be created)
Set<QName> disabledBehaviours = getDisabledBehaviours(node);
List<QName> alreadyDisabledBehaviours = new ArrayList<QName>();
for (QName disabledBehaviour: disabledBehaviours)
{
boolean alreadyDisabled = behaviourFilter.disableBehaviour(disabledBehaviour);
if (alreadyDisabled)
{
disabledBehaviours.remove(disabledBehaviour);
alreadyDisabledBehaviours.add(disabledBehaviour);
}
}
disabledBehaviours.removeAll(alreadyDisabledBehaviours);
// Build initial map of properties
Map<QName, Serializable> initialProperties = bindProperties(node);
@@ -1276,7 +1278,6 @@ public class ImporterComponent
ChildAssociationRef childAssocRef = nodeService.getPrimaryParent(existingNodeRef);
// TODO: Check for root node
nodeService.removeChild(childAssocRef.getParentRef(), childAssocRef.getChildRef());
}
}

View File

@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessPermission;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName;
@@ -340,6 +341,13 @@ public class NodeContext extends ElementContext
*/
public void addAccessControlEntry(AccessStatus accessStatus, String authority, String permission)
{
// Note: Map guest permission to Consumer permission - this is to handle the case where
// exports made against a pre 1.2 RC2 release
if (permission.equalsIgnoreCase("guest"))
{
permission = PermissionService.CONSUMER;
}
ACE ace = new ACE();
ace.accessStatus = accessStatus;
ace.authority = authority;