mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
SAIL-388 - PermissionDAO: Remove redundant DbAccessControlList entity (and associated helper methods)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20999 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,8 +20,8 @@ package org.alfresco.repo.avm;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -194,13 +194,13 @@ public interface AVMNode
|
||||
* Set an ACL on this node.
|
||||
* @param acl The ACL to set.
|
||||
*/
|
||||
public void setAcl(DbAccessControlList acl);
|
||||
public void setAcl(Acl acl);
|
||||
|
||||
/**
|
||||
* Get the ACL on this node.
|
||||
* @return The ACL on this node.
|
||||
*/
|
||||
public DbAccessControlList getAcl();
|
||||
public Acl getAcl();
|
||||
|
||||
/**
|
||||
* Set the store that we are new in.
|
||||
@@ -222,7 +222,7 @@ public interface AVMNode
|
||||
*/
|
||||
public void copyACLs(AVMNode other, ACLCopyMode mode);
|
||||
|
||||
public void copyACLs(DbAccessControlList otherAcl, DbAccessControlList parentAcl, ACLCopyMode mode);
|
||||
public void copyACLs(Acl otherAcl, Acl parentAcl, ACLCopyMode mode);
|
||||
|
||||
/**
|
||||
* Copy metadata from another node.
|
||||
|
@@ -24,9 +24,9 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.avm.util.RawServices;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.avm.AVMHistoryLinkEntity;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.service.cmr.avm.AVMReadOnlyException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -72,7 +72,7 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
/**
|
||||
* The ACL on this node.
|
||||
*/
|
||||
private DbAccessControlList fACL;
|
||||
private Acl fACL;
|
||||
|
||||
/**
|
||||
* The Store that we're new in.
|
||||
@@ -364,12 +364,12 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
|
||||
public void copyACLs(AVMNode other, ACLCopyMode mode)
|
||||
{
|
||||
DbAccessControlList otherAcl = other.getAcl();
|
||||
Acl otherAcl = other.getAcl();
|
||||
Long otherAclId = (otherAcl == null ? null : otherAcl.getId());
|
||||
copyACLs(otherAclId, otherAclId, mode);
|
||||
}
|
||||
|
||||
public void copyACLs(DbAccessControlList otherAcl, DbAccessControlList parentAcl, ACLCopyMode mode)
|
||||
public void copyACLs(Acl otherAcl, Acl parentAcl, ACLCopyMode mode)
|
||||
{
|
||||
Long otherAclId = (otherAcl == null ? null : otherAcl.getId());
|
||||
Long parentAclId = (parentAcl == null ? null : parentAcl.getId());
|
||||
@@ -379,7 +379,7 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
|
||||
protected void copyACLs(AVMNode other, Long parentAcl, ACLCopyMode mode)
|
||||
{
|
||||
DbAccessControlList otherAcl = other.getAcl();
|
||||
Acl otherAcl = other.getAcl();
|
||||
copyACLs((otherAcl == null ? null : otherAcl.getId()), parentAcl, mode);
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
{
|
||||
if (otherAcl != null)
|
||||
{
|
||||
DbAccessControlList aclCopy = AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(otherAcl, parentAcl, mode);
|
||||
Acl aclCopy = AVMDAOs.Instance().fAclDAO.getAclCopy(otherAcl, parentAcl, mode);
|
||||
setAcl(aclCopy);
|
||||
}
|
||||
else
|
||||
@@ -498,7 +498,7 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
* Set the ACL on this node.
|
||||
* @param acl The ACL to set.
|
||||
*/
|
||||
public void setAcl(DbAccessControlList acl)
|
||||
public void setAcl(Acl acl)
|
||||
{
|
||||
fACL = acl;
|
||||
}
|
||||
@@ -507,7 +507,7 @@ public abstract class AVMNodeImpl implements AVMNode
|
||||
* Get the ACL on this node.
|
||||
* @return The ACL on this node.
|
||||
*/
|
||||
public DbAccessControlList getAcl()
|
||||
public Acl getAcl()
|
||||
{
|
||||
return fACL;
|
||||
}
|
||||
|
@@ -32,9 +32,9 @@ import java.util.SortedMap;
|
||||
import org.alfresco.model.WCMModel;
|
||||
import org.alfresco.repo.avm.util.AVMUtil;
|
||||
import org.alfresco.repo.content.ContentStore;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.avm.AVMStoreEntity;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
@@ -1024,7 +1024,7 @@ public class AVMRepository
|
||||
{
|
||||
AVMNode node = fAVMNodeDAO.getByID(vr.getRoot().getId());
|
||||
|
||||
root.setIsRoot(false);
|
||||
node.setIsRoot(false);
|
||||
fAVMNodeDAO.update(node);
|
||||
|
||||
fVersionLayeredNodeEntryDAO.delete(vr);
|
||||
@@ -2758,7 +2758,7 @@ public class AVMRepository
|
||||
* @param acl
|
||||
* The ACL to set.
|
||||
*/
|
||||
public void setACL(String path, DbAccessControlList acl)
|
||||
public void setACL(String path, Acl acl)
|
||||
{
|
||||
fLookupCount.set(1);
|
||||
try
|
||||
@@ -2787,7 +2787,7 @@ public class AVMRepository
|
||||
* The path to the node.
|
||||
* @return The ACL.
|
||||
*/
|
||||
public DbAccessControlList getACL(int version, String path)
|
||||
public Acl getACL(int version, String path)
|
||||
{
|
||||
fLookupCount.set(1);
|
||||
try
|
||||
@@ -3233,7 +3233,7 @@ public class AVMRepository
|
||||
*/
|
||||
public boolean can(AVMStore store, AVMNode node, String permission, boolean isDirectlyContained)
|
||||
{
|
||||
DbAccessControlList acl = node.getAcl();
|
||||
Acl acl = node.getAcl();
|
||||
|
||||
QName type;
|
||||
if (node.getType() == AVMNodeType.PLAIN_DIRECTORY)
|
||||
@@ -3335,7 +3335,7 @@ public class AVMRepository
|
||||
}
|
||||
if (store != null)
|
||||
{
|
||||
DbAccessControlList storeAcl = store.getStoreAcl();
|
||||
Acl storeAcl = store.getStoreAcl();
|
||||
if (storeAcl != null)
|
||||
{
|
||||
Long storeAclID = storeAcl.getId();
|
||||
@@ -3407,7 +3407,7 @@ public class AVMRepository
|
||||
* @param storeName
|
||||
* @param acl
|
||||
*/
|
||||
public void setStoreAcl(String storeName, DbAccessControlList acl)
|
||||
public void setStoreAcl(String storeName, Acl acl)
|
||||
{
|
||||
AVMStore store = getAVMStoreByName(storeName);
|
||||
if (store == null)
|
||||
@@ -3425,7 +3425,7 @@ public class AVMRepository
|
||||
* @param storeName
|
||||
* @return
|
||||
*/
|
||||
public DbAccessControlList getStoreAcl(String storeName)
|
||||
public Acl getStoreAcl(String storeName)
|
||||
{
|
||||
AVMStore store = getAVMStoreByName(storeName);
|
||||
if (store == null)
|
||||
|
@@ -31,8 +31,8 @@ import java.util.SortedMap;
|
||||
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.repo.avm.util.AVMUtil;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
@@ -1502,17 +1502,17 @@ public class AVMServiceImpl implements AVMService
|
||||
}
|
||||
|
||||
|
||||
private DbAccessControlList getAclAsSystem(final int version, final String path)
|
||||
private Acl getAclAsSystem(final int version, final String path)
|
||||
{
|
||||
return AuthenticationUtil.runAs(new RunAsWork<DbAccessControlList>(){
|
||||
return AuthenticationUtil.runAs(new RunAsWork<Acl>(){
|
||||
|
||||
public DbAccessControlList doWork() throws Exception
|
||||
public Acl doWork() throws Exception
|
||||
{
|
||||
return fAVMRepository.getACL(version, path);
|
||||
}}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
private void setAclAsSystem(final String path, final DbAccessControlList acl)
|
||||
private void setAclAsSystem(final String path, final Acl acl)
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>(){
|
||||
|
||||
@@ -1533,13 +1533,13 @@ public class AVMServiceImpl implements AVMService
|
||||
{
|
||||
String newPath = path + '/' + name;
|
||||
AVMNodeDescriptor existing = lookup(-1, newPath);
|
||||
DbAccessControlList parentAcl = getAclAsSystem(-1, path);
|
||||
Acl parentAcl = getAclAsSystem(-1, path);
|
||||
Long parentAclId = null;
|
||||
if(parentAcl != null)
|
||||
{
|
||||
parentAclId = parentAcl.getId();
|
||||
}
|
||||
DbAccessControlList acl = getAclAsSystem(version, desc.getPath());
|
||||
Acl acl = getAclAsSystem(version, desc.getPath());
|
||||
|
||||
if (desc.isFile())
|
||||
{
|
||||
@@ -1552,7 +1552,7 @@ public class AVMServiceImpl implements AVMService
|
||||
createFile(path, name, in);
|
||||
if (acl != null)
|
||||
{
|
||||
setAclAsSystem(newPath, AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(acl.getId(), parentAclId, ACLCopyMode.COPY));
|
||||
setAclAsSystem(newPath, AVMDAOs.Instance().fAclDAO.getAclCopy(acl.getId(), parentAclId, ACLCopyMode.COPY));
|
||||
}
|
||||
ContentData cd = getContentDataForRead(version, desc.getPath());
|
||||
setEncoding(newPath, cd.getEncoding());
|
||||
@@ -1571,7 +1571,7 @@ public class AVMServiceImpl implements AVMService
|
||||
// Set acl before creating children as acls inherit :-)
|
||||
if (acl != null)
|
||||
{
|
||||
setAclAsSystem(newPath, AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(acl.getId(), parentAclId, ACLCopyMode.COPY));
|
||||
setAclAsSystem(newPath, AVMDAOs.Instance().fAclDAO.getAclCopy(acl.getId(), parentAclId, ACLCopyMode.COPY));
|
||||
}
|
||||
}
|
||||
Map<String, AVMNodeDescriptor> listing = getDirectoryListing(desc);
|
||||
|
@@ -33,7 +33,7 @@ import junit.framework.TestCase;
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.domain.AccessControlListDAO;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.domain.permissions.AclDAO;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -512,20 +512,20 @@ public class AVMServicePermissionsTest extends TestCase
|
||||
|
||||
AVMNodeDescriptor desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base");
|
||||
AVMNode node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList acl = node.getAcl();
|
||||
Acl acl = node.getAcl();
|
||||
assertNotNull(acl);
|
||||
acl = aclDaoComponent.getDbAccessControlList(aclDaoComponent.getInheritedAccessControlList(acl.getId()));
|
||||
acl = aclDaoComponent.getAcl(aclDaoComponent.getInheritedAccessControlList(acl.getId()));
|
||||
assertNotNull(acl);
|
||||
|
||||
desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base/update-dir");
|
||||
node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList dirAcl = node.getAcl();
|
||||
Acl dirAcl = node.getAcl();
|
||||
assertNotNull(dirAcl);
|
||||
assertEquals(acl.getId(), dirAcl.getId());
|
||||
|
||||
desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base/update-dir/update-file");
|
||||
node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList fileAcl = node.getAcl();
|
||||
Acl fileAcl = node.getAcl();
|
||||
assertNotNull(fileAcl);
|
||||
assertEquals(acl.getId(), fileAcl.getId());
|
||||
|
||||
@@ -595,20 +595,20 @@ public class AVMServicePermissionsTest extends TestCase
|
||||
|
||||
AVMNodeDescriptor desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base");
|
||||
AVMNode node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList acl = node.getAcl();
|
||||
Acl acl = node.getAcl();
|
||||
assertNotNull(acl);
|
||||
acl = aclDaoComponent.getDbAccessControlList(aclDaoComponent.getInheritedAccessControlList(acl.getId()));
|
||||
acl = aclDaoComponent.getAcl(aclDaoComponent.getInheritedAccessControlList(acl.getId()));
|
||||
assertNotNull(acl);
|
||||
|
||||
desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base/update-dir");
|
||||
node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList dirAcl = node.getAcl();
|
||||
Acl dirAcl = node.getAcl();
|
||||
assertNotNull(dirAcl);
|
||||
assertEquals(acl.getId(), dirAcl.getId());
|
||||
|
||||
desc = avmService.lookup(-1, storeName + "-layer-base:/layer-to-base/update-dir/update-file");
|
||||
node = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList fileAcl = node.getAcl();
|
||||
Acl fileAcl = node.getAcl();
|
||||
assertNotNull(fileAcl);
|
||||
assertEquals(acl.getId(), fileAcl.getId());
|
||||
|
||||
@@ -811,7 +811,7 @@ public class AVMServicePermissionsTest extends TestCase
|
||||
// debugPermissions(storeName + ":/base");
|
||||
// debugPermissions(storeName + "-layer-base:/layer-to-base");
|
||||
//
|
||||
// DbAccessControlList acl = avmACLDAO.getAccessControlList(nodeRef);
|
||||
// Acl acl = avmACLDAO.getAccessControlList(nodeRef);
|
||||
// List<Long> nodes = aclDaoComponent.getAvmNodesByACL(acl.getId());
|
||||
// for (Long id : nodes)
|
||||
// {
|
||||
@@ -3346,7 +3346,7 @@ public class AVMServicePermissionsTest extends TestCase
|
||||
{
|
||||
AVMNodeDescriptor desc = avmService.lookup(-1, path);
|
||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, desc.getPath());
|
||||
DbAccessControlList acl = avmACLDAO.getAccessControlList(nodeRef);
|
||||
Acl acl = avmACLDAO.getAccessControlList(nodeRef);
|
||||
System.out.println(path);
|
||||
System.out.println("\t => Ind="
|
||||
+ desc.getIndirection() + ",Deleted=" + desc.isDeleted() + ",LD=" + desc.isLayeredDirectory() + ",LF=" + desc.isLayeredFile() + ",PD=" + desc.isPlainDirectory()
|
||||
@@ -3916,7 +3916,7 @@ public class AVMServicePermissionsTest extends TestCase
|
||||
builder.append(" - ");
|
||||
|
||||
AVMNode layeredNode = avmNodeDAO.getByID(desc.getId());
|
||||
DbAccessControlList acl = layeredNode.getAcl();
|
||||
Acl acl = layeredNode.getAcl();
|
||||
builder.append(acl);
|
||||
|
||||
builder.append('\n');
|
||||
|
@@ -26,8 +26,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.avm.VersionDescriptor;
|
||||
@@ -69,13 +69,13 @@ public interface AVMStore
|
||||
* Get the Acl associated with this store.
|
||||
* @return
|
||||
*/
|
||||
public DbAccessControlList getStoreAcl();
|
||||
public Acl getStoreAcl();
|
||||
|
||||
/**
|
||||
* Set the acl on this store.
|
||||
* @param acl
|
||||
*/
|
||||
public void setStoreAcl(DbAccessControlList acl);
|
||||
public void setStoreAcl(Acl acl);
|
||||
|
||||
/**
|
||||
* Snapshots this store. This sets all nodes in the
|
||||
@@ -478,7 +478,7 @@ public interface AVMStore
|
||||
* @param path The path to the node.
|
||||
* @param acl The ACL to set.
|
||||
*/
|
||||
public void setACL(String path, DbAccessControlList acl);
|
||||
public void setACL(String path, Acl acl);
|
||||
|
||||
/**
|
||||
* Get the ACL on a node.
|
||||
@@ -486,7 +486,7 @@ public interface AVMStore
|
||||
* @param path The path to the node.
|
||||
* @return The ACL.
|
||||
*/
|
||||
public DbAccessControlList getACL(int version, String path);
|
||||
public Acl getACL(int version, String path);
|
||||
|
||||
/**
|
||||
* Link a node into a directory, directly.
|
||||
|
@@ -36,8 +36,8 @@ import org.alfresco.model.WCMModel;
|
||||
import org.alfresco.repo.avm.util.AVMUtil;
|
||||
import org.alfresco.repo.avm.util.RawServices;
|
||||
import org.alfresco.repo.avm.util.SimplePath;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
@@ -101,7 +101,7 @@ public class AVMStoreImpl implements AVMStore
|
||||
/**
|
||||
* Acl for this store.
|
||||
*/
|
||||
private DbAccessControlList fACL;
|
||||
private Acl fACL;
|
||||
|
||||
/**
|
||||
* The AVMRepository.
|
||||
@@ -1168,12 +1168,12 @@ public class AVMStoreImpl implements AVMStore
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMStore#getAcl()
|
||||
*/
|
||||
public DbAccessControlList getStoreAcl()
|
||||
public Acl getStoreAcl()
|
||||
{
|
||||
return fACL;
|
||||
}
|
||||
|
||||
public void setStoreAcl(DbAccessControlList acl)
|
||||
public void setStoreAcl(Acl acl)
|
||||
{
|
||||
fACL = acl;
|
||||
}
|
||||
@@ -1772,7 +1772,7 @@ public class AVMStoreImpl implements AVMStore
|
||||
* @param path The path to the node.
|
||||
* @param acl The ACL to set.
|
||||
*/
|
||||
public void setACL(String path, DbAccessControlList acl)
|
||||
public void setACL(String path, Acl acl)
|
||||
{
|
||||
Lookup lPath = lookup(-1, path, true, true);
|
||||
if (lPath == null)
|
||||
@@ -1796,7 +1796,7 @@ public class AVMStoreImpl implements AVMStore
|
||||
* @param path The path to the node.
|
||||
* @return The ACL.
|
||||
*/
|
||||
public DbAccessControlList getACL(int version, String path)
|
||||
public Acl getACL(int version, String path)
|
||||
{
|
||||
Lookup lPath = lookup(version, path, false, false);
|
||||
if (lPath == null)
|
||||
|
@@ -27,11 +27,10 @@ import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.alfresco.repo.avm.util.AVMUtil;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl;
|
||||
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMNotFoundException;
|
||||
@@ -661,7 +660,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
/*
|
||||
* Get acl
|
||||
*/
|
||||
private DbAccessControlList getACL(String path)
|
||||
private Acl getACL(String path)
|
||||
{
|
||||
Lookup lookup = AVMRepository.GetInstance().lookup(-1, path, false);
|
||||
if (lookup != null)
|
||||
@@ -680,8 +679,8 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
*/
|
||||
private void setACL(String parentPath, String toCopyPath, String newPath)
|
||||
{
|
||||
DbAccessControlList parentAcl= getACL(parentPath);
|
||||
DbAccessControlList acl = getACL(toCopyPath);
|
||||
Acl parentAcl= getACL(parentPath);
|
||||
Acl acl = getACL(toCopyPath);
|
||||
|
||||
Lookup lookup = AVMRepository.GetInstance().lookup(-1, newPath, false);
|
||||
if (lookup != null)
|
||||
@@ -1046,8 +1045,8 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
// compare ACLs
|
||||
private int compareACLs(AVMNodeDescriptor srcDesc, AVMNodeDescriptor dstDesc)
|
||||
{
|
||||
DbAccessControlList srcAcl = getACL(srcDesc.getPath());
|
||||
DbAccessControlList dstAcl = getACL(dstDesc.getPath());
|
||||
Acl srcAcl = getACL(srcDesc.getPath());
|
||||
Acl dstAcl = getACL(dstDesc.getPath());
|
||||
|
||||
if ((srcAcl == null) && (dstAcl == null))
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class DeletedNodeImpl extends AVMNodeImpl implements DeletedNode
|
||||
* Create a new one from scratch.
|
||||
* @param store The store it's being created in.
|
||||
*/
|
||||
public DeletedNodeImpl(AVMStore store, DbAccessControlList acl)
|
||||
public DeletedNodeImpl(AVMStore store, Acl acl)
|
||||
{
|
||||
super(store);
|
||||
this.setAcl(acl);
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
|
||||
/**
|
||||
* Interface for Layered Directories.
|
||||
@@ -110,5 +110,5 @@ public interface LayeredDirectoryNode extends DirectoryNode, Layered
|
||||
*/
|
||||
public boolean getOpacity();
|
||||
|
||||
public void setAclAndInherit(LayeredDirectoryNode layeredDirectory, DbAccessControlList acl, String name);
|
||||
public void setAclAndInherit(LayeredDirectoryNode layeredDirectory, Acl acl, String name);
|
||||
}
|
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
|
||||
@@ -872,7 +872,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
{
|
||||
if ((getAcl() == null) || (getAcl().getAclType() == ACLType.LAYERED))
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, getIndirection());
|
||||
if (lookup != null)
|
||||
{
|
||||
@@ -886,7 +886,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
else
|
||||
{
|
||||
|
||||
acl = AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(getAcl().getId(), dir.getAcl().getId(), ACLCopyMode.REDIRECT);
|
||||
acl = AVMDAOs.Instance().fAclDAO.getAclCopy(getAcl().getId(), dir.getAcl().getId(), ACLCopyMode.REDIRECT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -897,7 +897,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
}
|
||||
else
|
||||
{
|
||||
acl = AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(getAcl().getId(), null, ACLCopyMode.REDIRECT);
|
||||
acl = AVMDAOs.Instance().fAclDAO.getAclCopy(getAcl().getId(), null, ACLCopyMode.REDIRECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -908,21 +908,21 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
{
|
||||
if (getAcl().getAclType() == ACLType.LAYERED)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
if (getAcl() == null)
|
||||
{
|
||||
acl = AVMDAOs.Instance().fAclDAO.createLayeredAcl(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
acl = AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(getAcl().getId(), null, ACLCopyMode.REDIRECT);
|
||||
acl = AVMDAOs.Instance().fAclDAO.getAclCopy(getAcl().getId(), null, ACLCopyMode.REDIRECT);
|
||||
}
|
||||
setAclAndInherit(this, acl, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAclAndInherit(LayeredDirectoryNode layeredDirectory, DbAccessControlList acl, String name)
|
||||
public void setAclAndInherit(LayeredDirectoryNode layeredDirectory, Acl acl, String name)
|
||||
{
|
||||
// Note ACLS may COW on next ACL change
|
||||
layeredDirectory.setAcl(acl);
|
||||
@@ -937,7 +937,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
if (node instanceof LayeredDirectoryNode)
|
||||
{
|
||||
LayeredDirectoryNode childNode = (LayeredDirectoryNode) node;
|
||||
DbAccessControlList currentAcl = node.getAcl();
|
||||
Acl currentAcl = node.getAcl();
|
||||
if (currentAcl == null)
|
||||
{
|
||||
if (acl == null)
|
||||
@@ -946,7 +946,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
}
|
||||
else
|
||||
{
|
||||
childNode.setAclAndInherit(childNode, AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(acl.getId(), acl.getId(), ACLCopyMode.REDIRECT), key);
|
||||
childNode.setAclAndInherit(childNode, AVMDAOs.Instance().fAclDAO.getAclCopy(acl.getId(), acl.getId(), ACLCopyMode.REDIRECT), key);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -957,14 +957,14 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
}
|
||||
else
|
||||
{
|
||||
childNode.setAclAndInherit(childNode, AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(currentAcl.getId(), acl.getId(), ACLCopyMode.REDIRECT), key);
|
||||
childNode.setAclAndInherit(childNode, AVMDAOs.Instance().fAclDAO.getAclCopy(currentAcl.getId(), acl.getId(), ACLCopyMode.REDIRECT), key);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (node instanceof PlainFileNode)
|
||||
{
|
||||
PlainFileNode childNode = (PlainFileNode) node;
|
||||
DbAccessControlList currentAcl = node.getAcl();
|
||||
Acl currentAcl = node.getAcl();
|
||||
if (currentAcl == null)
|
||||
{
|
||||
if (acl == null)
|
||||
@@ -973,7 +973,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
}
|
||||
else
|
||||
{
|
||||
childNode.setAcl(AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(acl.getId(), acl.getId(), ACLCopyMode.REDIRECT));
|
||||
childNode.setAcl(AVMDAOs.Instance().fAclDAO.getAclCopy(acl.getId(), acl.getId(), ACLCopyMode.REDIRECT));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -984,7 +984,7 @@ public class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements Layer
|
||||
}
|
||||
else
|
||||
{
|
||||
childNode.setAcl(AVMDAOs.Instance().fAclDAO.getDbAccessControlListCopy(currentAcl.getId(), acl.getId(), ACLCopyMode.REDIRECT));
|
||||
childNode.setAcl(AVMDAOs.Instance().fAclDAO.getAclCopy(currentAcl.getId(), acl.getId(), ACLCopyMode.REDIRECT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
package org.alfresco.repo.avm;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.service.cmr.avm.AVMException;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
@@ -82,7 +82,7 @@ public class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
|
||||
* @param store
|
||||
* The store we belong to.
|
||||
*/
|
||||
public LayeredFileNodeImpl(String indirection, AVMStore store, DbAccessControlList acl)
|
||||
public LayeredFileNodeImpl(String indirection, AVMStore store, Acl acl)
|
||||
{
|
||||
super(store);
|
||||
setIndirection(indirection);
|
||||
@@ -142,7 +142,7 @@ public class LayeredFileNodeImpl extends FileNodeImpl implements LayeredFileNode
|
||||
throw new AVMException("Unbacked layered file node.");
|
||||
}
|
||||
DirectoryNode dir = lPath.getCurrentNodeDirectory();
|
||||
DbAccessControlList parentAcl = null;
|
||||
Acl parentAcl = null;
|
||||
if ((dir != null) && (dir.getAcl() != null))
|
||||
{
|
||||
parentAcl = dir.getAcl();
|
||||
|
@@ -21,9 +21,9 @@ package org.alfresco.repo.avm;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.avm.AVMHistoryLinkEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMMergeLinkEntity;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
@@ -362,7 +362,8 @@ public class OrphanReaper
|
||||
AVMDAOs.Instance().fAVMNodeDAO.deleteAspects(node.getId());
|
||||
|
||||
// Get rid of ACL.
|
||||
DbAccessControlList acl = node.getAcl();
|
||||
@SuppressWarnings("unused")
|
||||
Acl acl = node.getAcl();
|
||||
node.setAcl(null);
|
||||
// Unused acls will be garbage collected
|
||||
// Many acls will be shared
|
||||
|
@@ -22,9 +22,9 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.contentdata.ContentDataDAO;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
@@ -116,9 +116,9 @@ public class PlainFileNodeImpl extends FileNodeImpl implements PlainFileNode
|
||||
ContentData content,
|
||||
Map<QName, PropertyValue> props,
|
||||
Set<QName> aspects,
|
||||
DbAccessControlList acl,
|
||||
Acl acl,
|
||||
int versionID,
|
||||
DbAccessControlList parentAcl,
|
||||
Acl parentAcl,
|
||||
ACLCopyMode mode)
|
||||
{
|
||||
super(store);
|
||||
|
@@ -43,12 +43,12 @@ import org.alfresco.repo.avm.PlainDirectoryNode;
|
||||
import org.alfresco.repo.avm.PlainDirectoryNodeImpl;
|
||||
import org.alfresco.repo.avm.PlainFileNode;
|
||||
import org.alfresco.repo.avm.PlainFileNodeImpl;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.avm.AVMHistoryLinkEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMMergeLinkEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMNodeEntity;
|
||||
import org.alfresco.repo.domain.avm.AVMVersionRootEntity;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
@@ -486,10 +486,10 @@ class AVMNodeDAOIbatis implements AVMNodeDAO
|
||||
|
||||
node.setStoreNew(store);
|
||||
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
if (nodeEntity.getAclId() != null)
|
||||
{
|
||||
acl = AVMDAOs.Instance().fAclDAO.getDbAccessControlList(nodeEntity.getAclId());
|
||||
acl = AVMDAOs.Instance().fAclDAO.getAcl(nodeEntity.getAclId());
|
||||
}
|
||||
node.setAcl(acl);
|
||||
|
||||
|
@@ -27,8 +27,8 @@ import org.alfresco.repo.avm.AVMStore;
|
||||
import org.alfresco.repo.avm.AVMStoreDAO;
|
||||
import org.alfresco.repo.avm.AVMStoreImpl;
|
||||
import org.alfresco.repo.avm.DirectoryNode;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.avm.AVMStoreEntity;
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
|
||||
/**
|
||||
* iBATIS DAO wrapper for AVMStore
|
||||
@@ -127,10 +127,10 @@ class AVMStoreDAOIbatis implements AVMStoreDAO
|
||||
store.setNextVersionID(storeEntity.getVersion().intValue());
|
||||
store.setVers(storeEntity.getVers());
|
||||
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
if (storeEntity.getAclId() != null)
|
||||
{
|
||||
acl = AVMDAOs.Instance().fAclDAO.getDbAccessControlList(storeEntity.getAclId());
|
||||
acl = AVMDAOs.Instance().fAclDAO.getAcl(storeEntity.getAclId());
|
||||
}
|
||||
store.setStoreAcl(acl);
|
||||
|
||||
|
@@ -21,6 +21,7 @@ package org.alfresco.repo.domain;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.repo.security.permissions.impl.AclChange;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
@@ -43,7 +44,7 @@ public interface AccessControlListDAO
|
||||
* @return The ACL.
|
||||
* @throws InvalidNodeRefException
|
||||
*/
|
||||
public DbAccessControlList getAccessControlList(NodeRef nodeRef);
|
||||
public Acl getAccessControlList(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Set the ACL on a node.
|
||||
@@ -54,7 +55,7 @@ public interface AccessControlListDAO
|
||||
* The ACL.
|
||||
* @throws InvalidNodeRefException
|
||||
*/
|
||||
public void setAccessControlList(NodeRef nodeRef, DbAccessControlList acl);
|
||||
public void setAccessControlList(NodeRef nodeRef, Acl acl);
|
||||
|
||||
/**
|
||||
* Set the ACL on a node.
|
||||
@@ -85,9 +86,9 @@ public interface AccessControlListDAO
|
||||
|
||||
public Map<ACLType, Integer> patchAcls();
|
||||
|
||||
public DbAccessControlList getAccessControlList(StoreRef storeRef);
|
||||
public Acl getAccessControlList(StoreRef storeRef);
|
||||
|
||||
public void setAccessControlList(StoreRef storeRef, DbAccessControlList acl);
|
||||
public void setAccessControlList(StoreRef storeRef, Acl acl);
|
||||
|
||||
public void updateInheritance(Long childNodeId, Long oldParentNodeId, Long newParentNodeId);
|
||||
}
|
||||
|
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.domain;
|
||||
|
||||
import org.alfresco.repo.domain.permissions.Acl;
|
||||
|
||||
|
||||
/**
|
||||
* The interface to support persistence of node access control entries
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public interface DbAccessControlList extends Acl
|
||||
{
|
||||
}
|
@@ -30,7 +30,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.domain.AccessControlListDAO;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.node.NodeDAO;
|
||||
import org.alfresco.repo.domain.node.NodeIdAndAclId;
|
||||
import org.alfresco.repo.domain.permissions.AVMAccessControlListDAO.CounterSet;
|
||||
@@ -85,14 +84,14 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
return nodePair.getFirst();
|
||||
}
|
||||
|
||||
public DbAccessControlList getAccessControlList(NodeRef nodeRef)
|
||||
public Acl getAccessControlList(NodeRef nodeRef)
|
||||
{
|
||||
Long nodeId = getNodeIdNotNull(nodeRef);
|
||||
Long aclId = nodeDAO.getNodeAclId(nodeId);
|
||||
return aclDaoComponent.getDbAccessControlList(aclId);
|
||||
return aclDaoComponent.getAcl(aclId);
|
||||
}
|
||||
|
||||
public DbAccessControlList getAccessControlList(StoreRef storeRef)
|
||||
public Acl getAccessControlList(StoreRef storeRef)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -114,7 +113,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
{
|
||||
return null;
|
||||
}
|
||||
DbAccessControlList acl = getAccessControlList(parentAssocRefPair.getSecond().getParentRef());
|
||||
Acl acl = getAccessControlList(parentAssocRefPair.getSecond().getParentRef());
|
||||
if (acl != null)
|
||||
{
|
||||
return acl.getId();
|
||||
@@ -161,7 +160,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
// Do the children first
|
||||
|
||||
Long aclId = nodeDAO.getNodeAclId(nodeId);
|
||||
DbAccessControlList existingAcl = aclDaoComponent.getDbAccessControlList(aclId);
|
||||
Acl existingAcl = aclDaoComponent.getAcl(aclId);
|
||||
|
||||
Long toInherit = null;
|
||||
Long idToInheritFrom = null;
|
||||
@@ -182,7 +181,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
actuallyInherited = inherited;
|
||||
}
|
||||
}
|
||||
Acl newAcl = aclDaoComponent.createAcl(properties, existing.getEntries(), actuallyInherited);
|
||||
Acl newAcl = aclDaoComponent.createAccessControlList(properties, existing.getEntries(), actuallyInherited);
|
||||
idToInheritFrom = newAcl.getId();
|
||||
nodeDAO.setNodeAclId(nodeId, idToInheritFrom);
|
||||
}
|
||||
@@ -200,7 +199,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
result.increment(ACLType.DEFINING);
|
||||
|
||||
AccessControlListProperties properties = aclDaoComponent.getDefaultProperties();
|
||||
DbAccessControlList newAcl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl newAcl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = newAcl.getId();
|
||||
|
||||
idToInheritFrom = id;
|
||||
@@ -245,7 +244,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
nodeDAO.setNodeAclId(nodeId, aclId);
|
||||
}
|
||||
|
||||
public void setAccessControlList(NodeRef nodeRef, DbAccessControlList acl)
|
||||
public void setAccessControlList(NodeRef nodeRef, Acl acl)
|
||||
{
|
||||
Long aclId = null;
|
||||
if (acl != null)
|
||||
@@ -255,7 +254,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
setAccessControlList(nodeRef, aclId);
|
||||
}
|
||||
|
||||
public void setAccessControlList(StoreRef storeRef, DbAccessControlList acl)
|
||||
public void setAccessControlList(StoreRef storeRef, Acl acl)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -346,7 +345,7 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
else
|
||||
{
|
||||
DbAccessControlList dbAcl = aclDaoComponent.getDbAccessControlList(acl);
|
||||
Acl dbAcl = aclDaoComponent.getAcl(acl);
|
||||
if (dbAcl.getAclType() == ACLType.LAYERED)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
@@ -391,17 +390,17 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
setFixedAcls(childNodeId, newParentSharedAclId, null, null, changes, true);
|
||||
}
|
||||
}
|
||||
DbAccessControlList dbAccessControlList = aclDaoComponent.getDbAccessControlList(childAclId);
|
||||
if(dbAccessControlList != null)
|
||||
Acl acl = aclDaoComponent.getAcl(childAclId);
|
||||
if(acl != null)
|
||||
{
|
||||
if(dbAccessControlList.getInherits())
|
||||
if(acl.getInherits())
|
||||
{
|
||||
// Does it inherit from the old parent - if not nothing changes
|
||||
Long oldParentAclId = nodeDAO.getNodeAclId(oldParentNodeId);
|
||||
if(oldParentAclId != null)
|
||||
{
|
||||
Long oldParentSharedAclId = aclDaoComponent.getInheritedAccessControlList(oldParentAclId);
|
||||
Long sharedAclchildInheritsFrom = dbAccessControlList.getInheritsFrom();
|
||||
Long sharedAclchildInheritsFrom = acl.getInheritsFrom();
|
||||
if(childAclId.equals(oldParentSharedAclId))
|
||||
{
|
||||
// child had old shared acl
|
||||
@@ -419,17 +418,17 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
else if(sharedAclchildInheritsFrom.equals(oldParentSharedAclId))
|
||||
{
|
||||
// child has defining acl and needs to be remerged
|
||||
if (dbAccessControlList.getAclType() == ACLType.LAYERED)
|
||||
if (acl.getAclType() == ACLType.LAYERED)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
else if (dbAccessControlList.getAclType() == ACLType.DEFINING)
|
||||
else if (acl.getAclType() == ACLType.DEFINING)
|
||||
{
|
||||
Long newParentSharedAclId = aclDaoComponent.getInheritedAccessControlList(newParentAclId);
|
||||
@SuppressWarnings("unused")
|
||||
List<AclChange> newChanges = aclDaoComponent.mergeInheritedAccessControlList(newParentSharedAclId, childAclId);
|
||||
}
|
||||
else if (dbAccessControlList.getAclType() == ACLType.SHARED)
|
||||
else if (acl.getAclType() == ACLType.SHARED)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@@ -28,7 +28,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.repo.security.permissions.SimpleAccessControlListProperties;
|
||||
import org.alfresco.repo.security.permissions.impl.AclChange;
|
||||
@@ -46,7 +45,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoComponentImpl
|
||||
{
|
||||
@Override
|
||||
protected CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, DbAccessControlList existing)
|
||||
protected CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, Acl existing)
|
||||
{
|
||||
if (existing == null)
|
||||
{
|
||||
@@ -55,7 +54,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setInherits(inherit);
|
||||
properties.setVersioned(false);
|
||||
|
||||
DbAccessControlList acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl acl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = acl.getId();
|
||||
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
@@ -67,7 +66,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
SimpleAccessControlListProperties properties;
|
||||
Long id;
|
||||
List<AclChange> changes;
|
||||
DbAccessControlList acl;
|
||||
Acl acl;
|
||||
switch (existing.getAclType())
|
||||
{
|
||||
case OLD:
|
||||
@@ -83,7 +82,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setInherits(existing.getInherits());
|
||||
properties.setVersioned(false);
|
||||
|
||||
acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
acl = aclDaoComponent.createAccessControlList(properties);
|
||||
id = acl.getId();
|
||||
|
||||
changes = new ArrayList<AclChange>();
|
||||
@@ -103,7 +102,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
|
||||
public void deletePermissions(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
acl = getAccessControlList(nodeRef);
|
||||
@@ -123,7 +122,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
if (acl.getInheritsFrom() != null)
|
||||
{
|
||||
Long inheritsFrom = acl.getInheritsFrom();
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, aclDaoComponent.getDbAccessControlList(inheritsFrom));
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, aclDaoComponent.getAcl(inheritsFrom));
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, inheritsFrom, aclDaoComponent.getInheritedAccessControlList(acl.getId())));
|
||||
getACLDAO(nodeRef).updateChangedAcls(nodeRef, changes);
|
||||
@@ -138,7 +137,7 @@ public class ADMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setInherits(Boolean.FALSE);
|
||||
properties.setVersioned(false);
|
||||
|
||||
DbAccessControlList newAcl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl newAcl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = newAcl.getId();
|
||||
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, newAcl);
|
||||
|
@@ -37,7 +37,6 @@ import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMRepository;
|
||||
import org.alfresco.repo.avm.util.AVMUtil;
|
||||
import org.alfresco.repo.domain.AccessControlListDAO;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.domain.avm.AVMNodeDAO;
|
||||
import org.alfresco.repo.domain.avm.AVMNodeEntity;
|
||||
@@ -140,7 +139,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
if (descriptor.isPrimary())
|
||||
{
|
||||
DbAccessControlList acl = getAclAsSystem(descriptor.getIndirectionVersion(), descriptor.getIndirection());
|
||||
Acl acl = getAclAsSystem(descriptor.getIndirectionVersion(), descriptor.getIndirection());
|
||||
if (acl == null)
|
||||
{
|
||||
return null;
|
||||
@@ -152,7 +151,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
else
|
||||
{
|
||||
DbAccessControlList acl = getAclAsSystem(version, path);
|
||||
Acl acl = getAclAsSystem(version, path);
|
||||
if (acl == null)
|
||||
{
|
||||
return null;
|
||||
@@ -183,7 +182,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
return null;
|
||||
}
|
||||
|
||||
DbAccessControlList acl = getAclAsSystem(avmVersionPath.getFirst(), splitPath[0]);
|
||||
Acl acl = getAclAsSystem(avmVersionPath.getFirst(), splitPath[0]);
|
||||
if (acl == null)
|
||||
{
|
||||
return null;
|
||||
@@ -203,7 +202,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
* @return The ACL.
|
||||
* @throws InvalidNodeRefException
|
||||
*/
|
||||
public DbAccessControlList getAccessControlList(NodeRef nodeRef)
|
||||
public Acl getAccessControlList(NodeRef nodeRef)
|
||||
{
|
||||
Pair<Integer, String> avmVersionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef);
|
||||
int version = avmVersionPath.getFirst();
|
||||
@@ -227,7 +226,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
* The ACL.
|
||||
* @throws InvalidNodeRefException
|
||||
*/
|
||||
public void setAccessControlList(NodeRef nodeRef, DbAccessControlList acl)
|
||||
public void setAccessControlList(NodeRef nodeRef, Acl acl)
|
||||
{
|
||||
Pair<Integer, String> avmVersionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef);
|
||||
int version = avmVersionPath.getFirst();
|
||||
@@ -537,7 +536,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
|
||||
for (Pair<Integer, String> layerPath : layerPaths)
|
||||
{
|
||||
DbAccessControlList target = getAclAsSystem(-1, layerPath.getSecond());
|
||||
Acl target = getAclAsSystem(-1, layerPath.getSecond());
|
||||
if (target != null)
|
||||
{
|
||||
if (target.getAclType() == ACLType.LAYERED)
|
||||
@@ -590,7 +589,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
for (Pair<Integer, String> path : paths)
|
||||
{
|
||||
// No need to force COW - any inherited ACL will have COWED if the top ACL required it
|
||||
setAclAsSystem(path.getSecond(), aclDaoComponent.getDbAccessControlList(change.getAfter()));
|
||||
setAclAsSystem(path.getSecond(), aclDaoComponent.getAcl(change.getAfter()));
|
||||
NodeRef layeredNode = AVMNodeConverter.ToNodeRef(-1, path.getSecond());
|
||||
updateInheritedChangedAcls(layeredNode, changeMap, unchanged, aclDaoComponent.getInheritedAccessControlList(change.getAfter()), SetMode.DIRECT_ONLY,
|
||||
indirections);
|
||||
@@ -637,7 +636,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
|
||||
private void fixUpAcls(AVMNodeDescriptor descriptor, Map<Long, Long> changes, Set<Long> unchanged, Long unsetAcl, SetMode mode, Map<Long, Set<Long>> indirections)
|
||||
{
|
||||
DbAccessControlList acl = getAclAsSystem(-1, descriptor.getPath());
|
||||
Acl acl = getAclAsSystem(-1, descriptor.getPath());
|
||||
Long id = null;
|
||||
if (acl != null)
|
||||
{
|
||||
@@ -647,7 +646,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
if (id == null)
|
||||
{
|
||||
// No need to force COW - ACL should have COWed if required
|
||||
setAclAsSystem(descriptor.getPath(), aclDaoComponent.getDbAccessControlList(unsetAcl));
|
||||
setAclAsSystem(descriptor.getPath(), aclDaoComponent.getAcl(unsetAcl));
|
||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, descriptor.getPath());
|
||||
updateReferencingLayeredAcls(nodeRef, unsetAcl, indirections);
|
||||
}
|
||||
@@ -656,7 +655,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
Long updateId = changes.get(id);
|
||||
if (updateId != id)
|
||||
{
|
||||
DbAccessControlList newAcl = aclDaoComponent.getDbAccessControlList(updateId);
|
||||
Acl newAcl = aclDaoComponent.getAcl(updateId);
|
||||
// No need to force COW - ACL should have COWed if required
|
||||
setAclAsSystem(descriptor.getPath(), newAcl);
|
||||
}
|
||||
@@ -767,8 +766,8 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
|
||||
// Simple set does not require any special COW wire up
|
||||
// The AVM node will COW as required
|
||||
DbAccessControlList previous = getAclAsSystem(-1, descriptor.getPath());
|
||||
setAclAsSystem(descriptor.getPath(), aclDaoComponent.getDbAccessControlList(mergeFrom));
|
||||
Acl previous = getAclAsSystem(-1, descriptor.getPath());
|
||||
setAclAsSystem(descriptor.getPath(), aclDaoComponent.getAcl(mergeFrom));
|
||||
if (previous == null)
|
||||
{
|
||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, descriptor.getPath());
|
||||
@@ -801,7 +800,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
|
||||
AVMNodeDescriptor child = children.get(key);
|
||||
|
||||
DbAccessControlList acl = getAclAsSystem(-1, child.getPath());
|
||||
Acl acl = getAclAsSystem(-1, child.getPath());
|
||||
|
||||
if (acl == null)
|
||||
{
|
||||
@@ -823,7 +822,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
{
|
||||
if (change.getBefore().equals(acl.getId()))
|
||||
{
|
||||
setAclAsSystem(child.getPath(), aclDaoComponent.getDbAccessControlList(change.getAfter()));
|
||||
setAclAsSystem(child.getPath(), aclDaoComponent.getAcl(change.getAfter()));
|
||||
setFixedAcls(child, change.getAfter(), null, newChanges, SetMode.DIRECT_ONLY, false, indirections);
|
||||
changes.addAll(newChanges);
|
||||
break;
|
||||
@@ -928,7 +927,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
}
|
||||
|
||||
DbAccessControlList existingAcl = getAclAsSystem(-1, node.getPath());
|
||||
Acl existingAcl = getAclAsSystem(-1, node.getPath());
|
||||
|
||||
if (existingAcl != null)
|
||||
{
|
||||
@@ -940,7 +939,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
|
||||
DbAccessControlList newAcl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl newAcl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = newAcl.getId();
|
||||
|
||||
AccessControlList existing = aclDaoComponent.getAccessControlList(existingAcl.getId());
|
||||
@@ -982,7 +981,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
AVMNodeDescriptor referencedNode = fAVMService.lookup(-1, node.getIndirection(), false);
|
||||
if ((referencedNode != null) && (referencedNode.isDirectory()))
|
||||
{
|
||||
DbAccessControlList acl = getAclAsSystem(-1, referencedNode.getPath());
|
||||
Acl acl = getAclAsSystem(-1, referencedNode.getPath());
|
||||
if (acl != null)
|
||||
{
|
||||
setAclAsSystem(node.getPath(), aclDaoComponent.createLayeredAcl(acl.getId()));
|
||||
@@ -1129,19 +1128,19 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
}
|
||||
|
||||
private DbAccessControlList getStoreAclAsSystem(final String storeName)
|
||||
private Acl getStoreAclAsSystem(final String storeName)
|
||||
{
|
||||
return AuthenticationUtil.runAs(new RunAsWork<DbAccessControlList>()
|
||||
return AuthenticationUtil.runAs(new RunAsWork<Acl>()
|
||||
{
|
||||
|
||||
public DbAccessControlList doWork() throws Exception
|
||||
public Acl doWork() throws Exception
|
||||
{
|
||||
return fAVMRepository.getStoreAcl(storeName);
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
private void setStoreAclAsSystem(final String storeName, final DbAccessControlList acl)
|
||||
private void setStoreAclAsSystem(final String storeName, final Acl acl)
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
@@ -1154,19 +1153,19 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
private DbAccessControlList getAclAsSystem(final int version, final String path)
|
||||
private Acl getAclAsSystem(final int version, final String path)
|
||||
{
|
||||
return AuthenticationUtil.runAs(new RunAsWork<DbAccessControlList>()
|
||||
return AuthenticationUtil.runAs(new RunAsWork<Acl>()
|
||||
{
|
||||
|
||||
public DbAccessControlList doWork() throws Exception
|
||||
public Acl doWork() throws Exception
|
||||
{
|
||||
return fAVMRepository.getACL(version, path);
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
private void setAclAsSystem(final String path, final DbAccessControlList acl)
|
||||
private void setAclAsSystem(final String path, final Acl acl)
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
@@ -1179,7 +1178,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
public DbAccessControlList getAccessControlList(StoreRef storeRef)
|
||||
public Acl getAccessControlList(StoreRef storeRef)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1191,7 +1190,7 @@ public class AVMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
}
|
||||
|
||||
public void setAccessControlList(StoreRef storeRef, DbAccessControlList acl)
|
||||
public void setAccessControlList(StoreRef storeRef, Acl acl)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -28,7 +28,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.repo.security.permissions.AccessControlEntry;
|
||||
import org.alfresco.repo.security.permissions.AccessControlList;
|
||||
@@ -47,7 +46,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoComponentImpl
|
||||
{
|
||||
@Override
|
||||
protected CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, DbAccessControlList existing)
|
||||
protected CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, Acl existing)
|
||||
{
|
||||
if (existing == null)
|
||||
{
|
||||
@@ -55,7 +54,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
|
||||
DbAccessControlList acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl acl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = acl.getId();
|
||||
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
@@ -67,7 +66,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
SimpleAccessControlListProperties properties;
|
||||
Long id;
|
||||
List<AclChange> changes;
|
||||
DbAccessControlList acl;
|
||||
Acl acl;
|
||||
switch (existing.getAclType())
|
||||
{
|
||||
case OLD:
|
||||
@@ -83,7 +82,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setInherits(existing.getInherits());
|
||||
properties.setVersioned(true);
|
||||
|
||||
acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
acl = aclDaoComponent.createAccessControlList(properties);
|
||||
id = acl.getId();
|
||||
|
||||
changes = new ArrayList<AclChange>();
|
||||
@@ -108,7 +107,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
}
|
||||
properties.setVersioned(true);
|
||||
|
||||
acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
acl = aclDaoComponent.createAccessControlList(properties);
|
||||
id = acl.getId();
|
||||
|
||||
changes = new ArrayList<AclChange>();
|
||||
@@ -140,7 +139,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
|
||||
public void deletePermissions(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
acl = getAccessControlList(nodeRef);
|
||||
@@ -159,7 +158,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
if (acl.getInheritsFrom() != null)
|
||||
{
|
||||
Long inheritsFrom = acl.getInheritsFrom();
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, aclDaoComponent.getDbAccessControlList(inheritsFrom));
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, aclDaoComponent.getAcl(inheritsFrom));
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, inheritsFrom, aclDaoComponent.getInheritedAccessControlList(acl.getId())));
|
||||
getACLDAO(nodeRef).updateChangedAcls(nodeRef, changes);
|
||||
@@ -173,7 +172,7 @@ public class AVMPermissionsDaoComponentImpl extends AbstractPermissionsDaoCompon
|
||||
properties.setInherits(Boolean.FALSE);
|
||||
properties.setVersioned(true);
|
||||
|
||||
DbAccessControlList newAcl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
Acl newAcl = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = newAcl.getId();
|
||||
|
||||
getACLDAO(nodeRef).setAccessControlList(nodeRef, newAcl);
|
||||
|
@@ -31,7 +31,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.domain.AccessControlListDAO;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.security.permissions.ACEType;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.repo.security.permissions.AccessControlEntry;
|
||||
@@ -154,15 +153,14 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected DbAccessControlList getAccessControlList(NodeRef nodeRef)
|
||||
protected Acl getAccessControlList(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
return acl;
|
||||
return getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
}
|
||||
|
||||
protected CreationReport getMutableAccessControlList(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
if (acl == null)
|
||||
{
|
||||
return createAccessControlList(nodeRef, INHERIT_PERMISSIONS_DEFAULT, null);
|
||||
@@ -195,7 +193,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
// If the object does not exist it will repeatedly query to check its
|
||||
// non existence.
|
||||
NodePermissionEntry npe = null;
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
acl = getAccessControlList(nodeRef);
|
||||
@@ -238,7 +236,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
private SimpleNodePermissionEntry createSimpleNodePermissionEntry(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
if (acl == null)
|
||||
{
|
||||
// there isn't an access control list for the node - spoof a null one
|
||||
@@ -270,7 +268,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
private SimpleNodePermissionEntry createSimpleNodePermissionEntry(StoreRef storeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(storeRef).getAccessControlList(storeRef);
|
||||
Acl acl = getACLDAO(storeRef).getAccessControlList(storeRef);
|
||||
if (acl == null)
|
||||
{
|
||||
// there isn't an access control list for the node - spoof a null one
|
||||
@@ -294,7 +292,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
public boolean getInheritParentPermissions(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
acl = getAccessControlList(nodeRef);
|
||||
@@ -322,7 +320,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
public void deletePermissions(NodeRef nodeRef, final String authority)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
AccessControlListDAO aclDAO = getACLDAO(nodeRef);
|
||||
@@ -368,7 +366,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
*/
|
||||
public void deletePermission(NodeRef nodeRef, String authority, PermissionReference permission)
|
||||
{
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
AccessControlListDAO aclDAO = getACLDAO(nodeRef);
|
||||
@@ -453,7 +451,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
// Get the access control list
|
||||
// Note the logic here requires to know whether it was created or not
|
||||
DbAccessControlList existing = getAccessControlList(nodeRef);
|
||||
Acl existing = getAccessControlList(nodeRef);
|
||||
if (existing != null)
|
||||
{
|
||||
deletePermissions(nodeRef);
|
||||
@@ -483,7 +481,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
public void setInheritParentPermissions(NodeRef nodeRef, boolean inheritParentPermissions)
|
||||
{
|
||||
|
||||
DbAccessControlList acl = getAccessControlList(nodeRef);
|
||||
Acl acl = getAccessControlList(nodeRef);
|
||||
if ((acl == null) && (inheritParentPermissions == INHERIT_PERMISSIONS_DEFAULT))
|
||||
{
|
||||
return;
|
||||
@@ -515,7 +513,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
public void deletePermission(StoreRef storeRef, String authority, PermissionReference permission)
|
||||
{
|
||||
DbAccessControlList acl = getAccessControlList(storeRef);
|
||||
Acl acl = getAccessControlList(storeRef);
|
||||
if(acl == null)
|
||||
{
|
||||
return;
|
||||
@@ -528,9 +526,9 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
aclDaoComponent.deleteAccessControlEntries(acl.getId(), pattern);
|
||||
}
|
||||
|
||||
private DbAccessControlList getMutableAccessControlList(StoreRef storeRef)
|
||||
private Acl getMutableAccessControlList(StoreRef storeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(storeRef).getAccessControlList(storeRef);
|
||||
Acl acl = getACLDAO(storeRef).getAccessControlList(storeRef);
|
||||
if(acl == null)
|
||||
{
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
@@ -538,7 +536,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
properties.setInherits(false);
|
||||
properties.setVersioned(false);
|
||||
|
||||
acl = aclDaoComponent.createDbAccessControlList(properties);
|
||||
acl = aclDaoComponent.createAccessControlList(properties);
|
||||
getACLDAO(storeRef).setAccessControlList(storeRef, acl);
|
||||
}
|
||||
return acl;
|
||||
@@ -554,14 +552,14 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
return ret;
|
||||
}
|
||||
|
||||
private DbAccessControlList getAccessControlList(StoreRef storeRef)
|
||||
private Acl getAccessControlList(StoreRef storeRef)
|
||||
{
|
||||
return getACLDAO(storeRef).getAccessControlList(storeRef);
|
||||
}
|
||||
|
||||
public void deletePermissions(StoreRef storeRef, String authority)
|
||||
{
|
||||
DbAccessControlList acl = getAccessControlList(storeRef);
|
||||
Acl acl = getAccessControlList(storeRef);
|
||||
if(acl == null)
|
||||
{
|
||||
return;
|
||||
@@ -580,7 +578,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
public void setPermission(StoreRef storeRef, String authority, PermissionReference permission, boolean allow)
|
||||
{
|
||||
DbAccessControlList acl = getMutableAccessControlList(storeRef);
|
||||
Acl acl = getMutableAccessControlList(storeRef);
|
||||
|
||||
SimpleAccessControlEntry entry = new SimpleAccessControlEntry();
|
||||
entry.setAuthority(authority);
|
||||
@@ -600,7 +598,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
// If the object does not exist it will repeatedly query to check its
|
||||
// non existence.
|
||||
NodePermissionEntry npe = null;
|
||||
DbAccessControlList acl = null;
|
||||
Acl acl = null;
|
||||
try
|
||||
{
|
||||
acl = getAccessControlList(storeRef);
|
||||
@@ -626,7 +624,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
|
||||
public AccessControlListProperties getAccessControlListProperties(NodeRef nodeRef)
|
||||
{
|
||||
DbAccessControlList acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef);
|
||||
if(acl == null)
|
||||
{
|
||||
return null;
|
||||
@@ -634,7 +632,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
return aclDaoComponent.getAccessControlListProperties(acl.getId());
|
||||
}
|
||||
|
||||
protected abstract CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, DbAccessControlList existing);
|
||||
protected abstract CreationReport createAccessControlList(NodeRef nodeRef, boolean inherit, Acl existing);
|
||||
|
||||
|
||||
/**
|
||||
@@ -644,11 +642,11 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
*/
|
||||
static class CreationReport
|
||||
{
|
||||
DbAccessControlList created;
|
||||
Acl created;
|
||||
|
||||
List<AclChange> changes;
|
||||
|
||||
CreationReport(DbAccessControlList created, List<AclChange> changes)
|
||||
CreationReport(Acl created, List<AclChange> changes)
|
||||
{
|
||||
this.created = created;
|
||||
this.changes = changes;
|
||||
@@ -668,7 +666,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
* Set the ACL that was created
|
||||
* @param created
|
||||
*/
|
||||
public void setCreated(DbAccessControlList created)
|
||||
public void setCreated(Acl created)
|
||||
{
|
||||
this.created = created;
|
||||
}
|
||||
@@ -686,7 +684,7 @@ public abstract class AbstractPermissionsDaoComponentImpl implements Permissions
|
||||
* Get the created ACL
|
||||
* @return - the acl
|
||||
*/
|
||||
public DbAccessControlList getCreated()
|
||||
public Acl getCreated()
|
||||
{
|
||||
return created;
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ package org.alfresco.repo.domain.permissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
import org.alfresco.repo.security.permissions.AccessControlEntry;
|
||||
import org.alfresco.repo.security.permissions.AccessControlList;
|
||||
@@ -52,9 +51,11 @@ public interface AclDAO
|
||||
public Acl getAcl(Long id);
|
||||
|
||||
/**
|
||||
* Get an ACL
|
||||
* Get the ACL properties
|
||||
*
|
||||
* @return - the id of all ACLs affected
|
||||
*/
|
||||
public DbAccessControlList getDbAccessControlList(Long id);
|
||||
public AccessControlListProperties getAccessControlListProperties(Long id);
|
||||
|
||||
/**
|
||||
* Delete an ACL
|
||||
@@ -109,13 +110,6 @@ public interface AclDAO
|
||||
*/
|
||||
public List<AclChange> disableInheritance(Long id, boolean setInheritedOnAcl);
|
||||
|
||||
/**
|
||||
* Get the ACL properties
|
||||
*
|
||||
* @return - the id of all ACLs affected
|
||||
*/
|
||||
public AccessControlListProperties getAccessControlListProperties(Long id);
|
||||
|
||||
/**
|
||||
* Create a new ACL with default properties
|
||||
*
|
||||
@@ -134,23 +128,15 @@ public interface AclDAO
|
||||
/**
|
||||
* Create a new ACL with the given properties. Unset properties are assigned defaults.
|
||||
*
|
||||
* @return ID of AccessControlList
|
||||
* @return Acl
|
||||
*/
|
||||
public Long createAccessControlList(AccessControlListProperties properties);
|
||||
|
||||
public DbAccessControlList createDbAccessControlList(AccessControlListProperties properties);
|
||||
public Acl createAccessControlList(AccessControlListProperties properties);
|
||||
|
||||
/**
|
||||
* @see #createAccessControlList(AccessControlListProperties)
|
||||
* @return Acl
|
||||
*/
|
||||
public Acl createAcl(AccessControlListProperties properties);
|
||||
|
||||
/**
|
||||
* @see #createAccessControlList(AccessControlListProperties)
|
||||
* @return Acl
|
||||
*/
|
||||
public Acl createAcl(AccessControlListProperties properties, List<AccessControlEntry> aces, Long inherited);
|
||||
public Acl createAccessControlList(AccessControlListProperties properties, List<AccessControlEntry> aces, Long inherited);
|
||||
|
||||
/**
|
||||
* Get the id of the ACL inherited from the one given
|
||||
@@ -163,13 +149,13 @@ public interface AclDAO
|
||||
*/
|
||||
public List<AclChange> mergeInheritedAccessControlList(Long inherited, Long target);
|
||||
|
||||
public DbAccessControlList getDbAccessControlListCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode);
|
||||
public Acl getAclCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode);
|
||||
|
||||
public List<Long> getAVMNodesByAcl(long aclEntityId, int maxResults);
|
||||
|
||||
public List<Long> getADMNodesByAcl(long aclEntityId, int maxResults);
|
||||
|
||||
public DbAccessControlList createLayeredAcl(Long indirectedAcl);
|
||||
public Acl createLayeredAcl(Long indirectedAcl);
|
||||
|
||||
public void renameAuthority(String before, String after);
|
||||
|
||||
|
@@ -30,7 +30,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.security.permissions.ACEType;
|
||||
import org.alfresco.repo.security.permissions.ACLCopyMode;
|
||||
@@ -130,7 +129,7 @@ public class AclDAOImpl implements AclDAO
|
||||
*/
|
||||
public Long createAccessControlList()
|
||||
{
|
||||
return createAccessControlList(getDefaultProperties());
|
||||
return createAccessControlList(getDefaultProperties()).getId();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -145,26 +144,10 @@ public class AclDAOImpl implements AclDAO
|
||||
return properties;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#createAccessControlList(org.alfresco.repo.security.permissions.AccessControlListProperties)
|
||||
*/
|
||||
public Long createAccessControlList(AccessControlListProperties properties)
|
||||
{
|
||||
return createAcl(properties).getId();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#createDbAccessControlList(org.alfresco.repo.security.permissions.AccessControlListProperties)
|
||||
*/
|
||||
public DbAccessControlList createDbAccessControlList(AccessControlListProperties properties)
|
||||
{
|
||||
return (DbAccessControlList)createAcl(properties);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#createAcl(org.alfresco.repo.security.permissions.AccessControlListProperties)
|
||||
*/
|
||||
public Acl createAcl(AccessControlListProperties properties)
|
||||
public Acl createAccessControlList(AccessControlListProperties properties)
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
@@ -201,13 +184,13 @@ public class AclDAOImpl implements AclDAO
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return createAcl(properties, null, null);
|
||||
return createAccessControlList(properties, null, null);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#createAcl(org.alfresco.repo.security.permissions.AccessControlListProperties, java.util.List, java.lang.Long)
|
||||
*/
|
||||
public Acl createAcl(AccessControlListProperties properties, List<AccessControlEntry> aces, Long inherited)
|
||||
public Acl createAccessControlList(AccessControlListProperties properties, List<AccessControlEntry> aces, Long inherited)
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
@@ -983,11 +966,11 @@ public class AclDAOImpl implements AclDAO
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#getDbAccessControlList(java.lang.Long)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#getAccessControlListProperties(java.lang.Long)
|
||||
*/
|
||||
public DbAccessControlList getDbAccessControlList(Long id)
|
||||
public AccessControlListProperties getAccessControlListProperties(Long id)
|
||||
{
|
||||
return (DbAccessControlList)getAcl(id);
|
||||
return aclCrudDAO.getAcl(id);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -1012,7 +995,7 @@ public class AclDAOImpl implements AclDAO
|
||||
* @param id
|
||||
* @return the access control list
|
||||
*/
|
||||
public AccessControlList getAccessControlListImpl(final Long id)
|
||||
private AccessControlList getAccessControlListImpl(final Long id)
|
||||
{
|
||||
SimpleAccessControlList acl = new SimpleAccessControlList();
|
||||
AccessControlListProperties properties = getAccessControlListProperties(id);
|
||||
@@ -1062,14 +1045,6 @@ public class AclDAOImpl implements AclDAO
|
||||
return acl;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#getAccessControlListProperties(java.lang.Long)
|
||||
*/
|
||||
public AccessControlListProperties getAccessControlListProperties(Long id)
|
||||
{
|
||||
return aclCrudDAO.getAcl(id);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#getInheritedAccessControlList(java.lang.Long)
|
||||
*/
|
||||
@@ -1095,7 +1070,7 @@ public class AclDAOImpl implements AclDAO
|
||||
properties.setAclType(ACLType.SHARED);
|
||||
properties.setInherits(Boolean.TRUE);
|
||||
properties.setVersioned(acl.isVersioned());
|
||||
Long sharedId = createAcl(properties, null, null).getId();
|
||||
Long sharedId = createAccessControlList(properties, null, null).getId();
|
||||
getWritable(sharedId, id, null, null, id, true, changes, WriteMode.ADD_INHERITED);
|
||||
acl.setInheritedAcl(sharedId);
|
||||
inheritedAclId = sharedId;
|
||||
@@ -1422,7 +1397,7 @@ public class AclDAOImpl implements AclDAO
|
||||
properties.setInherits(aclToCopy.getInherits());
|
||||
properties.setVersioned(true);
|
||||
|
||||
Long id = createAccessControlList(properties);
|
||||
Long id = createAccessControlList(properties).getId();
|
||||
|
||||
AccessControlList indirectAcl = getAccessControlList(toCopy);
|
||||
for (AccessControlEntry entry : indirectAcl.getEntries())
|
||||
@@ -1462,9 +1437,9 @@ public class AclDAOImpl implements AclDAO
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.domain.permissions.AclDAO#getDbAccessControlListCopy(java.lang.Long, java.lang.Long, org.alfresco.repo.security.permissions.ACLCopyMode)
|
||||
*/
|
||||
public DbAccessControlList getDbAccessControlListCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode)
|
||||
public Acl getAclCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode)
|
||||
{
|
||||
return (DbAccessControlList)getAclEntityCopy(toCopy, toInheritFrom, mode);
|
||||
return getAclEntityCopy(toCopy, toInheritFrom, mode);
|
||||
}
|
||||
|
||||
private Acl getAclEntityCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode)
|
||||
@@ -1487,12 +1462,12 @@ public class AclDAOImpl implements AclDAO
|
||||
return aclCrudDAO.getADMNodesByAcl(aclEntityId, maxResults);
|
||||
}
|
||||
|
||||
public DbAccessControlList createLayeredAcl(Long indirectedAcl)
|
||||
public Acl createLayeredAcl(Long indirectedAcl)
|
||||
{
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.LAYERED);
|
||||
|
||||
DbAccessControlList acl = createDbAccessControlList(properties);
|
||||
Acl acl = createAccessControlList(properties);
|
||||
long id = acl.getId();
|
||||
|
||||
if (indirectedAcl != null)
|
||||
|
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.permissions;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.security.permissions.ACLType;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
|
||||
@@ -35,7 +34,7 @@ import org.alfresco.util.EqualsHelper;
|
||||
* @author janv
|
||||
* @since 3.4
|
||||
*/
|
||||
public class AclEntity implements Acl, DbAccessControlList
|
||||
public class AclEntity implements Acl
|
||||
{
|
||||
private Long id;
|
||||
private Long version;
|
||||
|
@@ -216,12 +216,12 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
assertEquals(aclProps.getAclType(), ACLType.DEFINING);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
|
||||
}
|
||||
|
||||
public void testCreateShared()
|
||||
@@ -229,19 +229,19 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
assertEquals(aclProps.getAclType(), ACLType.DEFINING);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
|
||||
|
||||
Long shared = aclDaoComponent.getInheritedAccessControlList(id);
|
||||
Long shared = aclDaoComponent.getInheritedAccessControlList(aclProps.getId());
|
||||
AccessControlListProperties sharedProps = aclDaoComponent.getAccessControlListProperties(shared);
|
||||
assertEquals(sharedProps.getAclType(), ACLType.SHARED);
|
||||
assertEquals(sharedProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(sharedProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(id), shared);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(aclProps.getId()), shared);
|
||||
}
|
||||
|
||||
public void testCreateOld()
|
||||
@@ -249,13 +249,13 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.OLD);
|
||||
properties.setVersioned(false);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
assertEquals(aclProps.getAclType(), ACLType.OLD);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(id), null);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(aclProps.getId()), null);
|
||||
}
|
||||
|
||||
public void testFixed()
|
||||
@@ -263,12 +263,13 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.FIXED);
|
||||
properties.setVersioned(true);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id = aclProps.getId();
|
||||
assertEquals(aclProps.getAclType(), ACLType.FIXED);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(id), id);
|
||||
}
|
||||
|
||||
@@ -277,12 +278,13 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.GLOBAL);
|
||||
properties.setVersioned(false);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id = aclProps.getId();
|
||||
assertEquals(aclProps.getAclType(), ACLType.GLOBAL);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
|
||||
assertEquals(aclDaoComponent.getInheritedAccessControlList(id), id);
|
||||
}
|
||||
|
||||
@@ -291,12 +293,13 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
|
||||
long id = aclProps.getId();
|
||||
assertEquals(aclProps.getAclType(), ACLType.DEFINING);
|
||||
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
|
||||
assertEquals(aclProps.getInherits(), Boolean.TRUE);
|
||||
assertEquals(aclDaoComponent.getAccessControlListProperties(id), aclProps);
|
||||
|
||||
SimpleAccessControlEntry ace1 = new SimpleAccessControlEntry();
|
||||
ace1.setAccessStatus(AccessStatus.ALLOWED);
|
||||
@@ -359,12 +362,12 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long def1 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def1 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long shared1 = aclDaoComponent.getInheritedAccessControlList(def1);
|
||||
Long def2 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def2 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared1, def2);
|
||||
Long shared2 = aclDaoComponent.getInheritedAccessControlList(def2);
|
||||
Long def3 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def3 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared2, def3);
|
||||
Long shared3 = aclDaoComponent.getInheritedAccessControlList(def3);
|
||||
|
||||
@@ -397,23 +400,23 @@ public class AclDaoComponentTest extends TestCase
|
||||
assertTrue(hasAce(aclDaoComponent.getAccessControlList(shared3).getEntries(), ace1, 5));
|
||||
|
||||
|
||||
Long def4 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def4 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared3, def4);
|
||||
Long shared4 = aclDaoComponent.getInheritedAccessControlList(def4);
|
||||
|
||||
Long def5 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def5 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared4, def5);
|
||||
Long shared5 = aclDaoComponent.getInheritedAccessControlList(def5);
|
||||
|
||||
Long def6_1 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def6_1 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared5, def6_1);
|
||||
Long shared6_1 = aclDaoComponent.getInheritedAccessControlList(def6_1);
|
||||
|
||||
Long def6_2 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def6_2 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared5, def6_2);
|
||||
Long shared6_2 = aclDaoComponent.getInheritedAccessControlList(def6_2);
|
||||
|
||||
Long def6_3 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long def6_3 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared5, def6_3);
|
||||
Long shared6_3 = aclDaoComponent.getInheritedAccessControlList(def6_3);
|
||||
|
||||
@@ -1064,7 +1067,7 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long defined = aclDaoComponent.createAccessControlList(properties);
|
||||
Long defined = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
SimpleAccessControlEntry ace1 = new SimpleAccessControlEntry();
|
||||
ace1.setAccessStatus(AccessStatus.ALLOWED);
|
||||
@@ -1092,17 +1095,17 @@ public class AclDaoComponentTest extends TestCase
|
||||
properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.FIXED);
|
||||
properties.setVersioned(true);
|
||||
Long fixed = aclDaoComponent.createAccessControlList(properties);
|
||||
Long fixed = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.GLOBAL);
|
||||
properties.setVersioned(true);
|
||||
Long global = aclDaoComponent.createAccessControlList(properties);
|
||||
Long global = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.OLD);
|
||||
properties.setVersioned(false);
|
||||
Long old = aclDaoComponent.createAccessControlList(properties);
|
||||
Long old = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
|
||||
aclDaoComponent.setAccessControlEntry(defined, ace1);
|
||||
@@ -1142,7 +1145,7 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
assertEquals(aclProps.getAclType(), ACLType.DEFINING);
|
||||
@@ -1196,27 +1199,27 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long i_1 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1 = aclDaoComponent.getInheritedAccessControlList(i_1);
|
||||
|
||||
Long i_1_2 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2 = aclDaoComponent.getInheritedAccessControlList(i_1_2);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1, i_1_2);
|
||||
Long i_1_3 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3 = aclDaoComponent.getInheritedAccessControlList(i_1_3);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1, i_1_3);
|
||||
|
||||
Long i_1_2_4 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2_4 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2_4 = aclDaoComponent.getInheritedAccessControlList(i_1_2_4);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_2, i_1_2_4);
|
||||
Long i_1_2_4_5 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2_4_5 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2_4_5 = aclDaoComponent.getInheritedAccessControlList(i_1_2_4_5);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_2_4, i_1_2_4_5);
|
||||
|
||||
Long i_1_3_6 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3_6 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3_6 = aclDaoComponent.getInheritedAccessControlList(i_1_3_6);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_3, i_1_3_6);
|
||||
Long i_1_3_6_7 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3_6_7 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3_6_7 = aclDaoComponent.getInheritedAccessControlList(i_1_3_6_7);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_3_6, i_1_3_6_7);
|
||||
|
||||
@@ -1264,28 +1267,28 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(true);
|
||||
Long i_1 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1 = aclDaoComponent.getInheritedAccessControlList(i_1);
|
||||
|
||||
Long i_1_2 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2 = aclDaoComponent.getInheritedAccessControlList(i_1_2);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1, i_1_2);
|
||||
Long i_1_3 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3 = aclDaoComponent.getInheritedAccessControlList(i_1_3);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1, i_1_3);
|
||||
|
||||
Long i_1_2_4 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2_4 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2_4 = aclDaoComponent.getInheritedAccessControlList(i_1_2_4);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_2, i_1_2_4);
|
||||
Long i_1_2_4_5 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_2_4_5 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_2_4_5 = aclDaoComponent.getInheritedAccessControlList(i_1_2_4_5);
|
||||
assertNotNull(s_1_2_4_5);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_2_4, i_1_2_4_5);
|
||||
|
||||
Long i_1_3_6 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3_6 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3_6 = aclDaoComponent.getInheritedAccessControlList(i_1_3_6);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_3, i_1_3_6);
|
||||
Long i_1_3_6_7 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long i_1_3_6_7 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long s_1_3_6_7 = aclDaoComponent.getInheritedAccessControlList(i_1_3_6_7);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(s_1_3_6, i_1_3_6_7);
|
||||
|
||||
@@ -1325,7 +1328,7 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.OLD);
|
||||
properties.setVersioned(false);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
|
||||
AccessControlListProperties aclProps = aclDaoComponent.getAccessControlListProperties(id);
|
||||
assertEquals(aclProps.getAclType(), ACLType.OLD);
|
||||
@@ -1370,9 +1373,9 @@ public class AclDaoComponentTest extends TestCase
|
||||
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
|
||||
properties.setAclType(ACLType.DEFINING);
|
||||
properties.setVersioned(false);
|
||||
Long id1 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id1 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long shared1 = aclDaoComponent.getInheritedAccessControlList(id1);
|
||||
Long id2 = aclDaoComponent.createAccessControlList(properties);
|
||||
Long id2 = aclDaoComponent.createAccessControlList(properties).getId();
|
||||
Long shared2 = aclDaoComponent.getInheritedAccessControlList(id2);
|
||||
aclDaoComponent.mergeInheritedAccessControlList(shared1, id2);
|
||||
|
||||
|
Reference in New Issue
Block a user