chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1182069 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/server/ main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ main/java/or...
Date Tue, 11 Oct 2011 20:20:34 GMT
Author: jens
Date: Tue Oct 11 20:20:33 2011
New Revision: 1182069

URL: http://svn.apache.org/viewvc?rev=1182069&view=rev
Log:
ACL support in InMemory: add default ACL if nothing is set, provide information for AtomPub
links, correct RepositoryInfo [CMIS-414]

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAce.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAcl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
Tue Oct 11 20:20:33 2011
@@ -136,7 +136,7 @@ public class AtomLinkInfoProvider {
         objInfo.setSupportsPolicies(false);
 
         // ACLs, currently not supported by in-memory provider
-        objInfo.setHasAcl(false);
+        objInfo.setHasAcl(true);
 
         objInfo.setSupportsDescendants(true);
         objInfo.setSupportsFolderTree(true);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
Tue Oct 11 20:20:33 2011
@@ -18,10 +18,20 @@
  */
 package org.apache.chemistry.opencmis.inmemory.server;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.commons.data.Ace;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
@@ -31,27 +41,44 @@ import org.apache.commons.logging.LogFac
 public class InMemoryAclService extends InMemoryAbstractServiceImpl {
 
     private static final Log LOG = LogFactory.getLog(InMemoryAclService.class.getName());
-    
+    final AtomLinkInfoProvider fAtomLinkProvider;
+
     public InMemoryAclService(StoreManager storeManager) {
         super(storeManager);
+        fAtomLinkProvider = new AtomLinkInfoProvider(fStoreManager);
     }
 
-    public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean
onlyBasicPermissions, ExtensionsData extension) {
+    public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean
onlyBasicPermissions,
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
         LOG.debug("start getObject()");
-
+        Acl acl = null;
         StoredObject so = validator.getAcl(context, repositoryId, objectId, extension);
         if (so instanceof DocumentVersion)
-            return ((DocumentVersion) so).getParentDocument().getAcl();
+            acl = ((DocumentVersion) so).getParentDocument().getAcl();
         else
-            return so.getAcl();
+            acl = so.getAcl();
+
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+        
+        return acl;
     }
 
     public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl addAces,
Acl removeAces, AclPropagation aclPropagation,
-            ExtensionsData extension) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         StoredObject so = validator.applyAcl(context, repositoryId, objectId, aclPropagation,
extension);
-        return fStoreManager.getObjectStore(repositoryId).applyAcl(so, addAces, removeAces,
aclPropagation, context.getUsername());
-       
+        Acl acl = fStoreManager.getObjectStore(repositoryId).applyAcl(so, addAces, removeAces,
aclPropagation, context.getUsername());
+        
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+        return acl;       
     }
     
     public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl aces,
AclPropagation aclPropagation) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
Tue Oct 11 20:20:33 2011
@@ -391,12 +391,12 @@ public class InMemoryService extends Abs
     @Override
     public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
             AclPropagation aclPropagation, ExtensionsData extension) {
-        return fAclSvc.applyAcl(getCallContext(), repositoryId, objectId, addAces, removeAces,
aclPropagation, extension);
+        return fAclSvc.applyAcl(getCallContext(), repositoryId, objectId, addAces, removeAces,
aclPropagation, extension, this);
     }
 
     @Override
     public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions,
ExtensionsData extension) {
-        return fAclSvc.getAcl(getCallContext(), repositoryId, objectId, onlyBasicPermissions,
extension);
+        return fAclSvc.getAcl(getCallContext(), repositoryId, objectId, onlyBasicPermissions,
extension, this);
     }
 
     // --- policy service ---

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAce.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAce.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAce.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAce.java
Tue Oct 11 20:20:33 2011
@@ -28,10 +28,17 @@ import org.apache.chemistry.opencmis.com
 
 public class InMemoryAce {
 
-    private final String principalId;
-    
+    private final String principalId;    
     private Permission permission;
     
+    public static final String getAnyoneUser() {
+        return "anyone";
+    }
+
+    public static final String getAnonymousUser() {
+        return "anonymous";
+    }
+
     public InMemoryAce(Ace commonsAce) {
         if (null == commonsAce || null == commonsAce.getPrincipalId() || null == commonsAce.getPermissions())
             throw new IllegalArgumentException("Cannot create InMemoryAce with null value");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAcl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAcl.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAcl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryAcl.java
Tue Oct 11 20:20:33 2011
@@ -61,7 +61,12 @@ public class InMemoryAcl {
         return acl;
     }
 
-
+    public static InMemoryAcl getDefaultAcl() {
+        List<InMemoryAce> defaultAcl = new ArrayList<InMemoryAce>();
+        defaultAcl.add(new InMemoryAce(InMemoryAce.getAnyoneUser(), Permission.ALL));   
    
+        return new InMemoryAcl(defaultAcl); 
+    }
+    
     public InMemoryAcl() {
         acl = new ArrayList<InMemoryAce>(3);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java
Tue Oct 11 20:20:33 2011
@@ -354,7 +354,7 @@ public class ObjectStoreImpl implements 
     
     public Acl getAcl(int aclId) {
         InMemoryAcl acl = getInMemoryAcl(aclId);
-        return acl==null ? null : acl.toCommonsAcl();
+        return acl==null ? InMemoryAcl.getDefaultAcl().toCommonsAcl() : acl.toCommonsAcl();
     }
     
     public int getAclId(StoredObjectImpl so, Acl addACEs, Acl removeACEs) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
Tue Oct 11 20:20:33 2011
@@ -29,8 +29,10 @@ import java.util.Set;
 
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.definitions.PermissionDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
 import org.apache.chemistry.opencmis.commons.enums.CapabilityAcl;
 import org.apache.chemistry.opencmis.commons.enums.CapabilityChanges;
 import org.apache.chemistry.opencmis.commons.enums.CapabilityContentStreamUpdates;
@@ -40,7 +42,9 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AclCapabilitiesDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryCapabilitiesImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl;
@@ -49,7 +53,6 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.TypeCreator;
 import org.apache.chemistry.opencmis.inmemory.TypeManagerImpl;
 import org.apache.chemistry.opencmis.inmemory.query.InMemoryQueryProcessor;
-import org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.CmisServiceValidator;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
@@ -311,8 +314,8 @@ public class StoreManagerImpl implements
         repoInfo.setCmisVersionSupported("1.0");
         repoInfo.setCapabilities(null);
         repoInfo.setRootFolder(rootFolderId);
-        repoInfo.setPrincipalAnonymous("anonymous");
-        repoInfo.setPrincipalAnyone("anyone");
+        repoInfo.setPrincipalAnonymous(InMemoryAce.getAnonymousUser());
+        repoInfo.setPrincipalAnyone(InMemoryAce.getAnyoneUser());
         repoInfo.setThinClientUri(null);
         repoInfo.setChangesIncomplete(Boolean.TRUE);
         repoInfo.setChangesOnType(null);
@@ -324,13 +327,12 @@ public class StoreManagerImpl implements
         // set capabilities
         RepositoryCapabilitiesImpl caps = new RepositoryCapabilitiesImpl();
         caps.setAllVersionsSearchable(false);
-        caps.setCapabilityAcl(CapabilityAcl.NONE);
+        caps.setCapabilityAcl(CapabilityAcl.MANAGE);
         caps.setCapabilityChanges(CapabilityChanges.PROPERTIES); // just for
         // testing
         caps.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.PWCONLY);
         caps.setCapabilityJoin(CapabilityJoin.NONE);
-        caps.setCapabilityQuery(CapabilityQuery.METADATAONLY); // just for
-        // testing
+        caps.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED); 
         caps.setCapabilityRendition(CapabilityRenditions.NONE);
         caps.setIsPwcSearchable(false);
         caps.setIsPwcUpdatable(true);
@@ -339,14 +341,14 @@ public class StoreManagerImpl implements
         caps.setSupportsMultifiling(true);
         caps.setSupportsUnfiling(true);
         caps.setSupportsVersionSpecificFiling(false);
+        caps.setCapabilityAcl(CapabilityAcl.MANAGE);
+        AclCapabilitiesDataImpl aclCaps = new AclCapabilitiesDataImpl();
+        aclCaps.setAclPropagation(AclPropagation.OBJECTONLY);
+        aclCaps.setPermissionDefinitionData(null);
+        aclCaps.setPermissionMappingData(null);
+        repoInfo.setAclCapabilities(aclCaps);
         repoInfo.setCapabilities(caps);
 
-        // AclCapabilitiesDataImpl aclCaps = new AclCapabilitiesDataImpl();
-        // aclCaps.setACLPropagation(AclPropagation.REPOSITORYDETERMINED);
-        // aclCaps.setPermissionDefinitionData(null);
-        // aclCaps.setPermissionMappingData(null);
-        // repoInfo.setACLCapabilities(aclCaps);
-        repoInfo.setAclCapabilities(null);
         fRepositoryInfo = repoInfo;
         return repoInfo;
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
Tue Oct 11 20:20:33 2011
@@ -378,10 +378,7 @@ public class StoredObjectImpl implements
     }
 
 	public Acl getAcl() {
-		if (0 == getAclId())
-		    return null;
-		else
-		    return fObjStore.getAcl(fAclId);
+	    return fObjStore.getAcl(fAclId);
 	}
 
 	public int getAclId() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
Tue Oct 11 20:20:33 2011
@@ -27,6 +27,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.Ace;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
@@ -45,6 +46,9 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyData;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyDefinition;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ChoiceImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java?rev=1182069&r1=1182068&r2=1182069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java
Tue Oct 11 20:20:33 2011
@@ -231,9 +231,11 @@ public class AclServiceTest extends Abst
         String id = createDocument(fRootFolderId, acl, null);
         LOG.debug("created document with id: " + id);
         
-        Acl aclReturn = fAclSvc.applyAcl(fRepositoryId, id, null, acl, AclPropagation.OBJECTONLY,
null);        
-        assertNull(aclReturn);
-                
+        Acl aclReturn = fAclSvc.applyAcl(fRepositoryId, id, null, acl, AclPropagation.OBJECTONLY,
null);
+        assertNotNull(aclReturn);
+        assertEquals(1, aclReturn.getAces().size());
+        assertTrue(aclHasPermission(aclReturn, "anyone", EnumBasicPermissions.CMIS_ALL.value()));
       
+
         LOG.info("... testRemoveAllAcls() finished.");
     }    
 



Mime
View raw message