mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user