Fix to only propagate ACLs down primary relationships

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9101 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2008-05-14 12:55:21 +00:00
parent 9d544f57b9
commit 2456d05ad9

View File

@@ -48,13 +48,10 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.repository.StoreRef;
/** /**
* DAO layer for the improved ACL implemtentation. * DAO layer for the improved ACL implemtentation. This layer is responsible for setting ACLs and any cascade behaviour
* * required. It also implements the migration from the old implementation to the new.
* This layer is responsible for setting ACLs and any cascade behaviour required.
* It also implements the migration from the old implementation to the new.
* *
* @author andyh * @author andyh
*
*/ */
public class DMAccessControlListDAO implements AccessControlListDAO public class DMAccessControlListDAO implements AccessControlListDAO
{ {
@@ -81,6 +78,7 @@ public class DMAccessControlListDAO implements AccessControlListDAO
/** /**
* Set the ACL DAO components * Set the ACL DAO components
*
* @param aclDaoComponent * @param aclDaoComponent
*/ */
public void setAclDaoComponent(AclDaoComponent aclDaoComponent) public void setAclDaoComponent(AclDaoComponent aclDaoComponent)
@@ -100,6 +98,7 @@ public class DMAccessControlListDAO implements AccessControlListDAO
/** /**
* Set the node service. * Set the node service.
*
* @param nodeService * @param nodeService
*/ */
public void setNodeService(NodeService nodeService) public void setNodeService(NodeService nodeService)
@@ -195,10 +194,13 @@ public class DMAccessControlListDAO implements AccessControlListDAO
// Do the children first // Do the children first
for (ChildAssociationRef child : nodeService.getChildAssocs(nodeRef)) for (ChildAssociationRef child : nodeService.getChildAssocs(nodeRef))
{
if (child.isPrimary())
{ {
CounterSet update = fixOldDmAcls(child.getChildRef()); CounterSet update = fixOldDmAcls(child.getChildRef());
result.add(update); result.add(update);
} }
}
DbAccessControlList existingAcl = getAccessControlList(nodeRef); DbAccessControlList existingAcl = getAccessControlList(nodeRef);
@@ -290,6 +292,8 @@ public class DMAccessControlListDAO implements AccessControlListDAO
List<ChildAssociationRef> children = nodeService.getChildAssocs(nodeRef); List<ChildAssociationRef> children = nodeService.getChildAssocs(nodeRef);
for (ChildAssociationRef child : children) for (ChildAssociationRef child : children)
{
if (child.isPrimary())
{ {
DbAccessControlList acl = getAccessControlList(child.getChildRef()); DbAccessControlList acl = getAccessControlList(child.getChildRef());
@@ -326,7 +330,7 @@ public class DMAccessControlListDAO implements AccessControlListDAO
hibernateSessionHelper.resetAndRemoveMark(); hibernateSessionHelper.resetAndRemoveMark();
} }
} }
}
} }
} }
@@ -358,6 +362,8 @@ public class DMAccessControlListDAO implements AccessControlListDAO
List<ChildAssociationRef> children = nodeService.getChildAssocs(nodeRef); List<ChildAssociationRef> children = nodeService.getChildAssocs(nodeRef);
for (ChildAssociationRef child : children) for (ChildAssociationRef child : children)
{
if (child.isPrimary())
{ {
DbAccessControlList acl = getAccessControlList(child.getChildRef(), nodeDaoService); DbAccessControlList acl = getAccessControlList(child.getChildRef(), nodeDaoService);
@@ -381,6 +387,7 @@ public class DMAccessControlListDAO implements AccessControlListDAO
} }
} }
} }
}
private static DbAccessControlList getAccessControlList(NodeRef nodeRef, NodeDaoService nodeDaoService) private static DbAccessControlList getAccessControlList(NodeRef nodeRef, NodeDaoService nodeDaoService)
{ {