More touch ups to AVM permissions stuff. ACLs are properly copied on write.

OrphanReaper cleans up ACLs.  Tests of same.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3710 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-06 20:53:38 +00:00
parent 920c487867
commit 17284e4dae
13 changed files with 111 additions and 10 deletions

View File

@@ -78,7 +78,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
public void setAccessControlList(NodeRef nodeRef, DbAccessControlList acl)
{
Object [] avmVersionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef);
int version = (Integer)avmVersionPath[1];
int version = (Integer)avmVersionPath[0];
if (version >= 0)
{
throw new InvalidNodeRefException("Read Only Node.", nodeRef);

View File

@@ -231,4 +231,20 @@ public class DbAccessControlListImpl extends LifecycleAdapter
// done
return accessControlEntry;
}
/**
* Make a copy of this ACL.
* @return The copy.
*/
public DbAccessControlList getCopy()
{
DbAccessControlList newAcl =
new DbAccessControlListImpl();
getSession().save(newAcl);
for (DbAccessControlEntry entry : entries)
{
newAcl.newEntry(entry.getPermission(), entry.getAuthority(), entry.isAllowed());
}
return newAcl;
}
}

View File

@@ -77,12 +77,6 @@ public class NodeAccessControlListDAO extends HibernateDaoSupport implements Acc
{
throw new InvalidNodeRefException(nodeRef);
}
DbAccessControlList oldAcl = node.getAccessControlList();
if (oldAcl != null)
{
node.setAccessControlList(null);
this.getHibernateTemplate().delete(oldAcl);
}
node.setAccessControlList(acl);
}
}

View File

@@ -38,7 +38,6 @@ import org.alfresco.repo.security.permissions.impl.SimplePermissionReference;
import org.alfresco.repo.transaction.TransactionalDao;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.GUID;