chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1178250 [1/3] - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/query/ main/java/org/apache/c...
Date Sun, 02 Oct 2011 20:35:13 GMT
Author: jens
Date: Sun Oct  2 20:35:12 2011
New Revision: 1178250

URL: http://svn.apache.org/viewvc?rev=1178250&view=rev
Log:
Add Acl support to InMemory Server [CMIS-414]

Added:
    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/test/java/org/apache/chemistry/opencmis/inmemory/AclPermissionsTest.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/DummyCallContext.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.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/server/InMemoryVersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.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/InMemoryServiceValidatorImpl.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/Permission.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/storedobj/impl/VersionedDocumentImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.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/AbstractServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DummyCallContext.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/DummyCallContext.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DummyCallContext.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DummyCallContext.java Sun Oct  2 20:35:12 2011
@@ -30,7 +30,13 @@ public class DummyCallContext implements
     private final Map<String, Object> fParameter = new HashMap<String, Object>();
 
     public DummyCallContext() {
-        fParameter.put(USERNAME, "TestUser");
+        fParameter.put(USERNAME, "Admin");
+        fParameter.put(PASSWORD, "secret");
+        fParameter.put(LOCALE, "en");
+    }
+
+    public DummyCallContext(String principalId) {
+        fParameter.put(USERNAME, principalId);
         fParameter.put(PASSWORD, "secret");
         fParameter.put(LOCALE, "en");
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.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/query/InMemoryQueryProcessor.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java Sun Oct  2 20:35:12 2011
@@ -79,8 +79,10 @@ public class InMemoryQueryProcessor {
     private List<StoredObject> matches = new ArrayList<StoredObject>();
     private QueryObject queryObj;
     private Tree whereTree;
-
-    public InMemoryQueryProcessor() {
+    private ObjectStoreImpl objStore;
+    
+    public InMemoryQueryProcessor(ObjectStoreImpl objStore) {
+        this.objStore = objStore;
     }
 
     /**
@@ -250,7 +252,7 @@ public class InMemoryQueryProcessor {
         if (null != node) {
             match = evalWhereNode(so, user, node);
         }
-        if (match)
+        if (match && objStore.hasReadAccess(user, so))
          {
             matches.add(so); // add to list
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.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/BaseServiceValidatorImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java Sun Oct  2 20:35:12 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.chemistry.opencmis.inmemory.server;
 
+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.enums.RelationshipDirection;
@@ -74,6 +75,30 @@ public class BaseServiceValidatorImpl im
         return so;
     }
 
+    protected StoredObject checkStandardParametersByPath(String repositoryId, String path, String user) {
+        if (null == repositoryId) {
+            throw new CmisInvalidArgumentException("Repository Id cannot be null.");
+        }
+
+        if (null == path) {
+            throw new CmisInvalidArgumentException("Path parameter cannot be null.");
+        }
+
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+
+        if (objStore == null) {
+            throw new CmisObjectNotFoundException("Unknown repository id: " + repositoryId);
+        }
+
+        StoredObject so = objStore.getObjectByPath(path, user);
+
+        if (so == null) {
+            throw new CmisObjectNotFoundException("Unknown path: " + path);
+        }
+
+        return so;
+    }
+
     protected StoredObject checkStandardParametersAllowNull(String repositoryId, String objectId) {
 
         StoredObject so = null;
@@ -236,7 +261,9 @@ public class BaseServiceValidatorImpl im
 
     public StoredObject getObject(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {
 
-        return checkStandardParameters(repositoryId, objectId);
+        String principalId = context.getUsername();
+        StoredObject so = checkStandardParameters(repositoryId, objectId);
+        return so;
     }
 
     public StoredObject getProperties(CallContext context, String repositoryId, String objectId,
@@ -251,10 +278,10 @@ public class BaseServiceValidatorImpl im
         return checkStandardParameters(repositoryId, objectId);
     }
 
-    public void getObjectByPath(CallContext context, String repositoryId, String path, ExtensionsData extension) {
+    public StoredObject getObjectByPath(CallContext context, String repositoryId, String path, ExtensionsData extension) {
 
-        checkRepositoryId(repositoryId);
-    }
+        return checkStandardParametersByPath(repositoryId, path, context.getUsername());
+   }
 
     public StoredObject getContentStream(CallContext context, String repositoryId, String objectId, String streamId,
             ExtensionsData extension) {
@@ -313,7 +340,7 @@ public class BaseServiceValidatorImpl im
     }
 
     public StoredObject checkIn(CallContext context, String repositoryId, Holder<String> objectId,
-            ExtensionsData extension) {
+            Acl addAces, Acl removeAces, ExtensionsData extension) {
         return checkStandardParameters(repositoryId, objectId.getValue());
     }
 

Added: 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=1178250&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java Sun Oct  2 20:35:12 2011
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.inmemory.server;
+
+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.server.CallContext;
+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;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class InMemoryAclService extends InMemoryAbstractServiceImpl {
+
+    private static final Log LOG = LogFactory.getLog(InMemoryAclService.class.getName());
+    
+    public InMemoryAclService(StoreManager storeManager) {
+        super(storeManager);
+    }
+
+    public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
+        LOG.debug("start getObject()");
+
+        StoredObject so = validator.getAcl(context, repositoryId, objectId, extension);
+        if (so instanceof DocumentVersion)
+            return ((DocumentVersion) so).getParentDocument().getAcl();
+        else
+            return so.getAcl();
+    }
+
+    public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl addAces, Acl removeAces, AclPropagation aclPropagation,
+            ExtensionsData extension) {
+
+        StoredObject so = validator.applyAcl(context, repositoryId, objectId, aclPropagation, extension);
+        return fStoreManager.getObjectStore(repositoryId).applyAcl(so, addAces, removeAces, aclPropagation, context.getUsername());
+       
+    }
+    
+    public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation) {
+        
+        StoredObject so = validator.applyAcl(context, repositoryId, objectId);
+        return fStoreManager.getObjectStore(repositoryId).applyAcl(so, aces, aclPropagation, context.getUsername());        
+    }
+
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.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/InMemoryObjectServiceImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java Sun Oct  2 20:35:12 2011
@@ -125,11 +125,18 @@ public class InMemoryObjectServiceImpl e
 
         // build properties collection
         List<String> requestedIds = FilterParser.getRequestedIdsFromFilter("*");
-        
+
         Properties existingProps = PropertyCreationHelper.getPropertiesFromObject(so, td, requestedIds, true);
 
-        PropertiesImpl newPD = PropertyCreationHelper.copyProperties(existingProps.getProperties(),
-                properties.getProperties());
+        PropertiesImpl newPD = new PropertiesImpl();
+        // copy all existing properties
+        for (PropertyData<?> prop : existingProps.getProperties().values()) {
+            newPD.addProperty(prop);
+        }
+        // overwrite all new properties
+        for (PropertyData<?> prop : properties.getProperties().values()) {
+            newPD.addProperty(prop);
+        }
 
         String res = createDocument(context, repositoryId, newPD, folderId, content, versioningState, policies,
                 addAces, removeAces, null);
@@ -150,7 +157,7 @@ public class InMemoryObjectServiceImpl e
     public String createPolicy(CallContext context, String repositoryId, Properties properties, String folderId,
             List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension) {
 
-        // TODO to be completed if ACLs are implemented
+        // TODO to be completed if policies are implemented
         LOG.debug("start createPolicy()");
         StoredObject so = createPolicyIntern(context, repositoryId, properties, folderId, policies, addAces, removeAces,
                 extension);
@@ -392,16 +399,9 @@ public class InMemoryObjectServiceImpl e
             Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getObjectByPath()");
-        validator.getObjectByPath(context, repositoryId, path, extension);
+        StoredObject so = validator.getObjectByPath(context, repositoryId, path, extension);
         String user = context.getUsername();
 
-        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
-        StoredObject so = objectStore.getObjectByPath(path, user);
-
-        if (so == null) {
-            throw new CmisObjectNotFoundException("Unknown path: " + path);
-        }
-
         TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
         ObjectData od = PropertyCreationHelper.getObjectData(td, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
@@ -589,9 +589,38 @@ public class InMemoryObjectServiceImpl e
         boolean hasUpdatedName = false;
         boolean hasUpdatedOtherProps = false;
 
-        hasUpdatedOtherProps = PropertyCreationHelper.updateProperties(oldProperties, properties.getProperties(),
-                typeDef, isCheckedOut);
-        
+        for (String key : properties.getProperties().keySet()) {
+            if (key.equals(PropertyIds.NAME))
+             {
+                continue; // ignore here
+            }
+
+            PropertyData<?> value = properties.getProperties().get(key);
+            PropertyDefinition<?> propDef = typeDef.getPropertyDefinitions().get(key);
+            if (value.getValues() == null || value.getFirstValue() == null) {
+                // delete property
+                // check if a required a property
+                if (propDef.isRequired()) {
+                    throw new CmisConstraintException(
+                            "updateProperties failed, following property can't be deleted, because it is required: "
+                                    + key);
+                }
+                oldProperties.remove(key);
+                hasUpdatedOtherProps = true;
+            } else {
+                if (propDef.getUpdatability().equals(Updatability.WHENCHECKEDOUT) && !isCheckedOut) {
+                    throw new CmisConstraintException(
+                            "updateProperties failed, following property can't be updated, because it is not checked-out: "
+                                    + key);
+                } else if (!propDef.getUpdatability().equals(Updatability.READWRITE)) {
+                    throw new CmisConstraintException(
+                            "updateProperties failed, following property can't be updated, because it is not writable: "
+                                    + key);
+                }
+                oldProperties.put(key, value);
+                hasUpdatedOtherProps = true;
+            }
+        }
 
         // get name from properties and perform special rename to check if
         // path already exists
@@ -672,6 +701,9 @@ public class InMemoryObjectServiceImpl e
         // Validation stuff
         TypeValidator.validateRequiredSystemProperties(properties);
     
+        // validate ACL
+        TypeValidator.validateAcl(typeDef, addACEs, removeACEs);
+        
         Folder folder = null;
         if (null != folderId) {
             StoredObject so = objectStore.getObjectById(folderId);

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=1178250&r1=1178249&r2=1178250&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 Sun Oct  2 20:35:12 2011
@@ -63,6 +63,7 @@ public class InMemoryService extends Abs
     private final InMemoryVersioningServiceImpl fVerSvc;
     private final InMemoryDiscoveryServiceImpl fDisSvc;
     private final InMemoryMultiFilingServiceImpl fMultiSvc;
+    private final InMemoryAclService fAclSvc;
 
     public StoreManager getStoreManager() {
         return storeManager;
@@ -76,6 +77,7 @@ public class InMemoryService extends Abs
         fVerSvc = new InMemoryVersioningServiceImpl(storeManager, fObjSvc);
         fDisSvc = new InMemoryDiscoveryServiceImpl(storeManager, fRepSvc, fNavSvc);
         fMultiSvc = new InMemoryMultiFilingServiceImpl(storeManager);
+        fAclSvc = new InMemoryAclService(storeManager);
     }
 
     public CallContext getCallContext() {
@@ -383,18 +385,18 @@ public class InMemoryService extends Abs
 
     @Override
     public Acl applyAcl(String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation) {
-        return super.applyAcl(repositoryId, objectId, aces, aclPropagation);
+        return fAclSvc.applyAcl(getCallContext(), repositoryId, objectId, aces, aclPropagation);
     }
 
     @Override
     public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
             AclPropagation aclPropagation, ExtensionsData extension) {
-        return super.applyAcl(repositoryId, objectId, addAces, removeAces, aclPropagation, extension);
+        return fAclSvc.applyAcl(getCallContext(), repositoryId, objectId, addAces, removeAces, aclPropagation, extension);
     }
 
     @Override
     public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
-        return super.getAcl(repositoryId, objectId, onlyBasicPermissions, extension);
+        return fAclSvc.getAcl(getCallContext(), repositoryId, objectId, onlyBasicPermissions, extension);
     }
 
     // --- policy service ---

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.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/InMemoryVersioningServiceImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Sun Oct  2 20:35:12 2011
@@ -75,15 +75,14 @@ public class InMemoryVersioningServiceIm
             Properties properties, ContentStream contentStream, String checkinComment, List<String> policies,
             Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
-        StoredObject so = validator.checkIn(context, repositoryId, objectId, extension);
+        StoredObject so = validator.checkIn(context, repositoryId, objectId, addAces, removeAces, extension);
 
         String user = context.getUsername();
         VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
 
         DocumentVersion pwc = verDoc.getPwc();
 
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, pwc);
-        verDoc.checkIn(major, properties, contentStream, checkinComment, user, typeDef);
+        verDoc.checkIn(major, properties, contentStream, checkinComment, user);
 
         // To be able to provide all Atom links in the response we need
         // additional information:

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.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/api/CmisServiceValidator.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java Sun Oct  2 20:35:12 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.chemistry.opencmis.inmemory.storedobj.api;
 
+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.enums.RelationshipDirection;
@@ -85,7 +86,7 @@ public interface CmisServiceValidator {
     StoredObject getRenditions(CallContext context, String repositoryId, String objectId,
             ExtensionsData extension);
 
-    void getObjectByPath(CallContext context, String repositoryId, String path,
+    StoredObject getObjectByPath(CallContext context, String repositoryId, String path,
             ExtensionsData extension);
 
     StoredObject getContentStream(CallContext context, String repositoryId, String objectId,
@@ -116,7 +117,7 @@ public interface CmisServiceValidator {
             ExtensionsData extension);
 
     StoredObject checkIn(CallContext context, String repositoryId, Holder<String> objectId,
-            ExtensionsData extension);
+            Acl addAces, Acl removeAces, ExtensionsData extension);
 
     StoredObject getObjectOfLatestVersion(CallContext context, String repositoryId, String objectId,
             String versionSeriesId, ExtensionsData extension);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.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/api/ObjectStore.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java Sun Oct  2 20:35:12 2011
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
 
@@ -196,4 +197,34 @@ public interface ObjectStore {
      */
     List<StoredObject> getCheckedOutDocuments(String orderBy, String user, IncludeRelationships includeRelationships);
     
+    /**
+     * Apply a ACLs by relative adding and removing a list of ACEs to/from an object
+     * 
+     * @param so
+     *      object where ACLs are applied
+     * @param addAces
+     *      list of ACEs to be added
+     * @param removeAces
+     *      list of ACEs to be removed
+     * @param aclPropagation
+     *      enum value how to propagate ACLs to child objects
+     * @return
+     *      new ACL of object
+     */
+    Acl applyAcl(StoredObject so, Acl addAces, Acl removeAces, AclPropagation aclPropagation, String principalId);
+    
+    /**
+     * Apply a ACLs by setting a new list of ACEs to an object
+     * 
+     * @param so
+     *      object where ACLs are applied
+     * @param aces
+     *      list of ACEs to be applied
+     * @param aclPropagation
+     *      enum value how to propagate ACLs to child objects
+     * @return
+     *      new ACL of object
+     */
+    Acl applyAcl(StoredObject so, Acl aces, AclPropagation aclPropagation, String principalId);
+    
 }
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.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/api/VersionedDocument.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java Sun Oct  2 20:35:12 2011
@@ -22,7 +22,6 @@ import java.util.List;
 
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.Properties;
-import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
 
 /**
@@ -55,8 +54,7 @@ public interface VersionedDocument exten
 
     DocumentVersion checkOut(ContentStream content, String user);
 
-    void checkIn(boolean isMajor, Properties properties, ContentStream content, String checkinComment, String user,
-            TypeDefinition typeDef);
+    void checkIn(boolean isMajor, Properties properties, ContentStream content, String checkinComment, String user);
 
     List<DocumentVersion> getAllVersions();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.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/AbstractMultiFilingImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/AbstractMultiFilingImpl.java Sun Oct  2 20:35:12 2011
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.inmemory.storedobj.impl;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
@@ -90,7 +91,17 @@ public abstract class AbstractMultiFilin
      * org.apache.opencmis.inmemory.storedobj.api.MultiParentPath#getParents()
      */
     public List<Folder> getParents(String user) {
-        return fParents;
+        if (null == fParents)
+            return null;
+        else if (null == user)
+            return Collections.unmodifiableList(fParents);
+        else {
+            List<Folder> visibleParents = new ArrayList<Folder>(fParents.size());
+            for (Folder folder : fParents)
+                if (fObjStore.hasReadAccess(user, folder))
+                    visibleParents.add(folder);
+            return visibleParents;
+        }
     }
 
     public boolean hasParent() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.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/DocumentVersionImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java Sun Oct  2 20:35:12 2011
@@ -239,6 +239,16 @@ public class DocumentVersionImpl extends
         }
     }
 
+    @Override
+    public int getAclId() {
+        return ((StoredObjectImpl)fContainer).getAclId();
+    }    
+
+    @Override
+    public void setAclId(int id) {
+        ((StoredObjectImpl)fContainer).setAclId(id);
+    }    
+    
     public List<Folder> getParents(String user) {
         return fContainer.getParents(user);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.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/FolderImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java Sun Oct  2 20:35:12 2011
@@ -120,7 +120,7 @@ public class FolderImpl extends Abstract
         for (String id : fObjStore.getIds()) {
             StoredObject obj = fObjStore.getObject(id);
             Filing pathObj = (Filing) obj;
-            if (pathObj.getParents(user).contains(this)) {
+            if (fObjStore.hasReadAccess(user, obj) && pathObj.getParents(user).contains(this)) {
                 if (pathObj instanceof VersionedDocument) {
                     DocumentVersion ver = ((VersionedDocument) pathObj).getLatestVersion(false);
                     result.add(ver);
@@ -149,7 +149,7 @@ public class FolderImpl extends Abstract
         List<Folder> result = new ArrayList<Folder>();
         for (String id : fObjStore.getIds()) {
             StoredObject obj = fObjStore.getObject(id);
-            if (obj instanceof SingleFiling) {
+            if (fObjStore.hasReadAccess(user, obj) && obj instanceof SingleFiling) {
                 SingleFiling pathObj = (SingleFiling) obj;
                 if (pathObj.getParent() == this && pathObj instanceof Folder) {
                     result.add((Folder) obj);

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=1178250&r1=1178249&r2=1178250&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 Sun Oct  2 20:35:12 2011
@@ -18,9 +18,12 @@
  */
 package org.apache.chemistry.opencmis.inmemory.storedobj.impl;
 
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
 
 
 public class InMemoryAce {
@@ -97,5 +100,9 @@ public class InMemoryAce {
         return "InMemoryAce [principalId=" + principalId + ", permission=" + permission + "]";
     }
 
+    public Ace toCommonsAce() {
+        return new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(principalId), 
+                Collections.singletonList(permission.toCmisString())); 
+    }
     
 }

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=1178250&r1=1178249&r2=1178250&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 Sun Oct  2 20:35:12 2011
@@ -25,10 +25,14 @@ 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.impl.dataobjects.AccessControlEntryImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
 
 public class InMemoryAcl {
     
     private List<InMemoryAce> acl;
+    private int id;
     
     private static class AceComparator<T extends InMemoryAce> implements Comparator<T> {
 
@@ -76,6 +80,14 @@ public class InMemoryAcl {
         }
     }
     
+    public void setId(int id) {
+        this.id = id;
+    }
+    
+    public int getId() {
+        return id;
+    }
+    
     public final List<InMemoryAce> getAces() {
         return acl;
     }
@@ -96,15 +108,33 @@ public class InMemoryAcl {
         return acl.remove(ace);
     }
     
+    public void mergeAcl(InMemoryAcl acl2) {
+        if (acl2 == null)
+            return;
+        for (InMemoryAce ace: acl2.getAces()) {
+            InMemoryAce existingAce  = getAce(ace.getPrincipalId());
+            if (existingAce == null)
+                acl.add(ace);   
+            else if (existingAce.getPermission().ordinal() < ace.getPermission().ordinal())
+                existingAce.setPermission(ace.getPermission());
+        }
+        Collections.sort(this.acl, COMP);
+    }
+    
     public Permission getPermission(String principalId) {
+        InMemoryAce ace = getAce(principalId);
+        return ace== null ? Permission.NONE : ace.getPermission();
+    }
+
+    private InMemoryAce getAce(String principalId) {
         if (null == principalId)
             return null;
         
         for (InMemoryAce ace : acl) {
             if (ace.getPrincipalId().equals(principalId))
-                return ace.getPermission();
+                return ace;
         }
-        return Permission.NONE;
+        return null;
     }
 
     public boolean hasPermission(String principalId, Permission permission) {
@@ -168,4 +198,16 @@ public class InMemoryAcl {
         return false;
     }
 
+    public Acl toCommonsAcl() {
+        List<Ace> commonsAcl = new ArrayList<Ace>();
+        for (InMemoryAce memAce : acl)
+            commonsAcl.add(memAce.toCommonsAce());
+        
+        return new AccessControlListImpl(commonsAcl); 
+    }
+
+    public InMemoryAcl clone() {
+        InMemoryAcl newAcl = new InMemoryAcl(acl);
+        return newAcl; 
+    }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryServiceValidatorImpl.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/InMemoryServiceValidatorImpl.java?rev=1178250&r1=1178249&r2=1178250&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryServiceValidatorImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryServiceValidatorImpl.java Sun Oct  2 20:35:12 2011
@@ -18,14 +18,641 @@
  */
 package org.apache.chemistry.opencmis.inmemory.storedobj.impl;
 
+import java.util.List;
+
+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.enums.RelationshipDirection;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.spi.Holder;
 import org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 
 public class InMemoryServiceValidatorImpl extends BaseServiceValidatorImpl {
 
     public InMemoryServiceValidatorImpl(StoreManager sm) {
         super(sm);
     }
-    
 
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkStandardParameters(java.lang.String, java.lang.String)
+     */
+    @Override
+    protected StoredObject checkStandardParameters(String repositoryId, String objectId) {
+
+        StoredObject so =  super.checkStandardParameters(repositoryId, objectId);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkStandardParametersAllowNull(java.lang.String, java.lang.String)
+     */
+    @Override
+    protected StoredObject checkStandardParametersAllowNull(String repositoryId, String objectId) {
+
+        StoredObject so = super.checkStandardParametersAllowNull(repositoryId, objectId);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkExistingObjectId(org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore, java.lang.String)
+     */
+    @Override
+    protected StoredObject checkExistingObjectId(ObjectStore objStore, String objectId) {
+
+        StoredObject so =  super.checkExistingObjectId(objStore, objectId);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkRepositoryId(java.lang.String)
+     */
+    @Override
+    protected void checkRepositoryId(String repositoryId) {
+
+        super.checkRepositoryId(repositoryId);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkParams(java.lang.String, java.lang.String, java.lang.String)
+     */
+    @Override
+    protected StoredObject[] checkParams(String repositoryId, String objectId1, String objectId2) {
+
+        StoredObject[] sos = super.checkParams(repositoryId, objectId1, objectId2);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getRepositoryInfos(org.apache.chemistry.opencmis.commons.server.CallContext, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getRepositoryInfos(CallContext context, ExtensionsData extension) {
+
+        super.getRepositoryInfos(context, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getRepositoryInfo(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getRepositoryInfo(CallContext context, String repositoryId, ExtensionsData extension) {
+
+        super.getRepositoryInfo(context, repositoryId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getTypeChildren(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getTypeChildren(CallContext context, String repositoryId, String typeId, ExtensionsData extension) {
+
+        super.getTypeChildren(context, repositoryId, typeId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getTypeDescendants(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getTypeDescendants(CallContext context, String repositoryId, String typeId, ExtensionsData extension) {
+
+        super.getTypeDescendants(context, repositoryId, typeId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getTypeDefinition(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getTypeDefinition(CallContext context, String repositoryId, String typeId, ExtensionsData extension) {
+
+        super.getTypeDefinition(context, repositoryId, typeId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getChildren(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getChildren(CallContext context, String repositoryId, String folderId, ExtensionsData extension) {
+
+        StoredObject so = super.getChildren(context, repositoryId, folderId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getDescendants(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getDescendants(CallContext context, String repositoryId, String folderId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getDescendants(context, repositoryId, folderId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getFolderTree(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getFolderTree(CallContext context, String repositoryId, String folderId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getFolderTree(context, repositoryId, folderId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getObjectParents(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getObjectParents(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getObjectParents(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getFolderParent(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getFolderParent(CallContext context, String repositoryId, String folderId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getFolderParent(context, repositoryId, folderId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getCheckedOutDocs(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getCheckedOutDocs(CallContext context, String repositoryId, String folderId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getCheckedOutDocs(context, repositoryId, folderId, extension);
+        if (null != so )
+            checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#createDocument(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject createDocument(CallContext context, String repositoryId, String folderId,
+            ExtensionsData extension) {
+
+        StoredObject folder = super.createDocument(context, repositoryId, folderId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), folder);
+        return folder;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#createDocumentFromSource(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject createDocumentFromSource(CallContext context, String repositoryId, String sourceId,
+            String folderId, ExtensionsData extension) {
+
+        StoredObject source = super.createDocumentFromSource(context, repositoryId, sourceId, folderId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), source);
+        return source;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#createFolder(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject createFolder(CallContext context, String repositoryId, String folderId, ExtensionsData extension) {
+
+        StoredObject parentFolder = super.createFolder(context, repositoryId, folderId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), parentFolder);
+        return parentFolder;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#createRelationship(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] createRelationship(CallContext context, String repositoryId, String sourceId,
+            String targetId, ExtensionsData extension) {
+
+        StoredObject[] sos = super.createRelationship(context, repositoryId, sourceId, targetId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), sos[0]);
+        checkWriteAccess(repositoryId, context.getUsername(), sos[1]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#createPolicy(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject createPolicy(CallContext context, String repositoryId, String folderId, ExtensionsData extension) {
+
+        StoredObject so = super.createPolicy(context, repositoryId, folderId, extension);
+        checkAllAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getAllowableActions(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getAllowableActions(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getAllowableActions(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getObject(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getObject(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {
+
+        StoredObject so = super.getObject(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getProperties(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getProperties(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getProperties(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getRenditions(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getRenditions(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getRenditions(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getObjectByPath(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getObjectByPath(CallContext context, String repositoryId, String path, ExtensionsData extension) {
+
+        StoredObject so =  super.getObjectByPath(context, repositoryId, path, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getContentStream(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getContentStream(CallContext context, String repositoryId, String objectId, String streamId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getContentStream(context, repositoryId, objectId, streamId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#updateProperties(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject updateProperties(CallContext context, String repositoryId, Holder<String> objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.updateProperties(context, repositoryId, objectId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#moveObject(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] moveObject(CallContext context, String repositoryId, Holder<String> objectId,
+            String targetFolderId, String sourceFolderId, ExtensionsData extension) {
+
+        StoredObject[] sos = super.moveObject(context, repositoryId, objectId, targetFolderId, sourceFolderId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), sos[0]);
+        checkReadAccess(repositoryId, context.getUsername(), sos[1]);
+        checkWriteAccess(repositoryId, context.getUsername(), sos[2]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#deleteObject(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.Boolean, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject deleteObject(CallContext context, String repositoryId, String objectId, Boolean allVersions,
+            ExtensionsData extension) {
+
+        StoredObject so = super.deleteObject(context, repositoryId, objectId, allVersions, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#deleteTree(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.Boolean, org.apache.chemistry.opencmis.commons.enums.UnfileObject, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject deleteTree(CallContext context, String repositoryId, String folderId, Boolean allVersions,
+            UnfileObject unfileObjects, ExtensionsData extension) {
+
+        StoredObject so = super.deleteTree(context, repositoryId, folderId, allVersions, unfileObjects, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#setContentStream(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, java.lang.Boolean, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject setContentStream(CallContext context, String repositoryId, Holder<String> objectId,
+            Boolean overwriteFlag, ExtensionsData extension) {
+
+        StoredObject so = super.setContentStream(context, repositoryId, objectId, overwriteFlag, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#deleteContentStream(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject deleteContentStream(CallContext context, String repositoryId, Holder<String> objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.deleteContentStream(context, repositoryId, objectId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+   }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkOut(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.data.ExtensionsData, org.apache.chemistry.opencmis.commons.spi.Holder)
+     */
+    @Override
+    public StoredObject checkOut(CallContext context, String repositoryId, Holder<String> objectId,
+            ExtensionsData extension, Holder<Boolean> contentCopied) {
+
+        StoredObject so = super.checkOut(context, repositoryId, objectId, extension, contentCopied);
+//        StoredObject container = so instanceof DocumentVersion ? ((DocumentVersion)so).getParentDocument() : so;
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#cancelCheckOut(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject cancelCheckOut(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.cancelCheckOut(context, repositoryId, objectId, extension);
+//        StoredObject container = so instanceof DocumentVersion ? ((DocumentVersion)so).getParentDocument() : so;
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#checkIn(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject checkIn(CallContext context, String repositoryId, Holder<String> objectId,
+            Acl addAces, Acl removeAces, ExtensionsData extension) {
+
+        StoredObject so = super.checkIn(context, repositoryId, objectId, addAces, removeAces, extension);
+//        StoredObject container = so instanceof DocumentVersion ? ((DocumentVersion)so).getParentDocument() : so;
+        
+        if (null != addAces || null != removeAces)
+            throw new CmisInvalidArgumentException(
+                    "version specific ACLs are not supported, addAces and removeAces must be null.");
+        
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getObjectOfLatestVersion(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getObjectOfLatestVersion(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, ExtensionsData extension) {
+
+        StoredObject so = super.getObjectOfLatestVersion(context, repositoryId, objectId, versionSeriesId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getPropertiesOfLatestVersion(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getPropertiesOfLatestVersion(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, ExtensionsData extension) {
+
+        StoredObject so = super.getPropertiesOfLatestVersion(context, repositoryId, objectId, versionSeriesId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getAllVersions(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getAllVersions(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, ExtensionsData extension) {
+
+        StoredObject so = super.getAllVersions(context, repositoryId, objectId, versionSeriesId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#query(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void query(CallContext context, String repositoryId, ExtensionsData extension) {
+
+        super.query(context, repositoryId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getContentChanges(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public void getContentChanges(CallContext context, String repositoryId, ExtensionsData extension) {
+
+        super.getContentChanges(context, repositoryId, extension);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#addObjectToFolder(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] addObjectToFolder(CallContext context, String repositoryId, String objectId, String folderId,
+            Boolean allVersions, ExtensionsData extension) {
+
+        StoredObject[] sos = super.addObjectToFolder(context, repositoryId, objectId, folderId, allVersions, extension);
+        checkReadAccess(repositoryId, context.getUsername(), sos[0]);
+        checkWriteAccess(repositoryId, context.getUsername(), sos[1]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#removeObjectFromFolder(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] removeObjectFromFolder(CallContext context, String repositoryId, String objectId,
+            String folderId, ExtensionsData extension) {
+
+        StoredObject[] sos = super.removeObjectFromFolder(context, repositoryId, objectId, folderId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), sos[0]);
+        checkWriteAccess(repositoryId, context.getUsername(), sos[1]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getObjectRelationships(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.enums.RelationshipDirection, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getObjectRelationships(CallContext context, String repositoryId, String objectId,
+            RelationshipDirection relationshipDirection, String typeId, ExtensionsData extension) {
+
+        StoredObject so = super.getObjectRelationships(context, repositoryId, objectId, relationshipDirection, typeId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getAcl(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getAcl(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {
+
+        StoredObject so = super.getAcl(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#applyAcl(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.enums.AclPropagation, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject applyAcl(CallContext context, String repositoryId, String objectId,
+            AclPropagation aclPropagation, ExtensionsData extension) {
+
+        StoredObject so = super.applyAcl(context, repositoryId, objectId, aclPropagation, extension);
+        checkAllAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#applyPolicy(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] applyPolicy(CallContext context, String repositoryId, String policyId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject[] sos = super.applyPolicy(context, repositoryId, policyId, objectId, extension);
+        checkAllAccess(repositoryId, context.getUsername(), sos[1]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#removePolicy(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject[] removePolicy(CallContext context, String repositoryId, String policyId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject[] sos = super.removePolicy(context, repositoryId, policyId, objectId, extension);
+        checkAllAccess(repositoryId, context.getUsername(), sos[1]);
+        return sos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#getAppliedPolicies(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject getAppliedPolicies(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.getAppliedPolicies(context, repositoryId, objectId, extension);
+        checkReadAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#create(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject create(CallContext context, String repositoryId, String folderId, ExtensionsData extension) {
+
+        StoredObject so = super.create(context, repositoryId, folderId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#deleteObjectOrCancelCheckOut(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String, org.apache.chemistry.opencmis.commons.data.ExtensionsData)
+     */
+    @Override
+    public StoredObject deleteObjectOrCancelCheckOut(CallContext context, String repositoryId, String objectId,
+            ExtensionsData extension) {
+
+        StoredObject so = super.deleteObjectOrCancelCheckOut(context, repositoryId, objectId, extension);
+        checkWriteAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.chemistry.opencmis.inmemory.server.BaseServiceValidatorImpl#applyAcl(org.apache.chemistry.opencmis.commons.server.CallContext, java.lang.String, java.lang.String)
+     */
+    @Override
+    public StoredObject applyAcl(CallContext context, String repositoryId, String objectId) {
+
+        StoredObject so = super.applyAcl(context, repositoryId, objectId);
+        checkAllAccess(repositoryId, context.getUsername(), so);
+        return so;
+    }
+    
+    private ObjectStoreImpl getObjectStore(String repositoryId) {
+        return (ObjectStoreImpl) fStoreManager.getObjectStore(repositoryId);
+    }
+    
+    private void checkReadAccess(String repositoryId, String principalId, StoredObject so) {
+        getObjectStore(repositoryId).checkReadAccess(principalId, so);
+    }
+    
+    private void checkWriteAccess(String repositoryId, String principalId, StoredObject so) {
+        getObjectStore(repositoryId).checkWriteAccess(principalId, so);
+    }
+    
+    private void checkAllAccess(String repositoryId, String principalId, StoredObject so) {
+        getObjectStore(repositoryId).checkAllAccess(principalId, so);
+    }
+ 
 }



Mime
View raw message