chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r800156 - in /incubator/chemistry/trunk/chemistry: chemistry-api/src/main/java/org/apache/chemistry/ chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/ chemistry-atompub-client/src/main/java/org/apache/chemistry/ato...
Date Sun, 02 Aug 2009 23:23:22 GMT
Author: fguillaume
Date: Sun Aug  2 23:23:22 2009
New Revision: 800156

URL: http://svn.apache.org/viewvc?rev=800156&view=rev
Log:
CMIS-44: added ACL framework

Added:
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java   (with props)
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java   (with props)
Modified:
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryCapabilities.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryInfo.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,46 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+/**
+ * An access control entry.
+ */
+public interface ACE {
+
+    /**
+     * The principal.
+     */
+    String getPrincipal();
+
+    /**
+     * The permission.
+     *
+     * @see Permission#READ
+     * @see Permission#WRITE
+     * @see Permission#DELETE
+     * @see Permission#ALL
+     */
+    String getPermission();
+
+    /**
+     * This is {@code true} if the ACE is directly assigned to the object
+     * itself, and {@code false} if the ACE is somehow derived from some other
+     * ACE or Policy applied to another object.
+     */
+    boolean isDirect();
+
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACE.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,83 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The level of support for ACLs by the repository.
+ *
+ * @see RepositoryCapabilities#getACLCapability
+ */
+public enum ACLCapability {
+
+    /**
+     * The repository does not support ACL services.
+     */
+    NONE("none"),
+
+    /**
+     * The repository supports discovery of ACLs ({@link SPI#getACL}).
+     *
+     * @see SPI#getACL
+     */
+    DISCOVER("discover"),
+
+    /**
+     * The repository supports discovery of ACLs and applying ACLs (
+     * {@link SPI#getACL} and {@link SPI#applyACL}).
+     *
+     * @see SPI#getACL
+     * @see SPI#applyACL
+     */
+    MANAGE("manage");
+
+    private final String value;
+
+    private ACLCapability(String value) {
+        this.value = value;
+    }
+
+    private static final Map<String, ACLCapability> all = new HashMap<String, ACLCapability>();
+    static {
+        for (ACLCapability o : values()) {
+            all.put(o.value, o);
+        }
+    }
+
+    public static ACLCapability get(String value) {
+        ACLCapability o = all.get(value);
+        if (o == null) {
+            throw new IllegalArgumentException(value);
+        }
+        return o;
+    }
+
+    public static ACLCapability get(String value, ACLCapability def) {
+        ACLCapability o = all.get(value);
+        if (o == null) {
+            o = def;
+        }
+        return o;
+    }
+
+    @Override
+    public String toString() {
+        return value;
+    }
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapability.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,67 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The type of ACL capabilities of the repository.
+ *
+ * @see RepositoryInfo#getACLCapabilityType
+ */
+public interface ACLCapabilityType {
+
+    /**
+     * Gets which types of permissions are supported by the repository (basic,
+     * repository-specific, or both).
+     */
+    PermissionsSupported getSupportedPermissions();
+
+    /**
+     * Gets how non-direct ACEs can be handled by the repository
+     */
+    ACLPropagation getACLPropagation();
+
+    /**
+     * The set of permissions supported by the repository.
+     * <p>
+     * This is only useful if {@link #getSupportedPermissions} is not
+     * {@link PermissionsSupported#BASIC}.
+     */
+    Set<Permission> getRepositoryPermissions();
+
+    /**
+     * The mapping of allowable actions to permissions.
+     * <p>
+     * The key is a unique name representing the allowable action plus one of
+     * the operands for this action that the mapping applies to. It is built by
+     * using the name of the allowable action (see
+     * {@link SPI#getAllowableActions}) and the name of the operand (without the
+     * ID or prefix)
+     * <p>
+     * The value is a permission.
+     *
+     * @see SPI#getAllowableActions
+     * @see Permission#READ
+     * @see Permission#WRITE
+     * @see Permission#DELETE
+     * @see Permission#ALL
+     */
+    Map<String, String> getPermissionMappings();
+
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLCapabilityType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,83 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Specifies how non-direct ACEs can be handled by the repository.
+ *
+ * @see SPI#applyACL
+ */
+public enum ACLPropagation {
+
+    /**
+     * The repository has its own mechanism of computing how changing an ACL for
+     * an object influences the non-direct ACEs of other objects.
+     */
+    REPOSITORY_DETERMINED("repository-determined"),
+
+    /**
+     * The repository is able to apply ACEs to a document or folder without
+     * changing the ACLs of other objects. This means that the repository is
+     * able to "break" the dependency for non-direct ACEs when requested by the
+     * client.
+     */
+    OBJECT_ONLY("object-only"),
+
+    /**
+     * The ACEs are applied to the given object and all "inheriting" objects,
+     * with the intended side effect that all objects which somehow share the
+     * provided security constraints should be changed accordingly.
+     */
+    PROPAGATE("propagate");
+
+    private final String value;
+
+    private ACLPropagation(String value) {
+        this.value = value;
+    }
+
+    private static final Map<String, ACLPropagation> all = new HashMap<String, ACLPropagation>();
+    static {
+        for (ACLPropagation o : values()) {
+            all.put(o.value, o);
+        }
+    }
+
+    public static ACLPropagation get(String value) {
+        ACLPropagation o = all.get(value);
+        if (o == null) {
+            throw new IllegalArgumentException(value);
+        }
+        return o;
+    }
+
+    public static ACLPropagation get(String value, ACLPropagation def) {
+        ACLPropagation o = all.get(value);
+        if (o == null) {
+            o = def;
+        }
+        return o;
+    }
+
+    @Override
+    public String toString() {
+        return value;
+    }
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ACLPropagation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,60 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+/**
+ * A repository permission.
+ */
+public interface Permission {
+
+    /**
+     * Permission to read properties and content streams.
+     * <p>
+     * Can cover more than this depending on the repository.
+     */
+    String READ = "cmis:read";
+
+    /**
+     * Permission to write properties and content stream.
+     * <p>
+     * Can cover more than this depending on the repository.
+     */
+    String WRITE = "cmis:write";
+
+    /**
+     * Permission to delete objects and object trees.
+     * <p>
+     * Can cover more than this depending on the repository.
+     */
+    String DELETE = "cmis:delete";
+
+    /**
+     * Covers all permissions.
+     */
+    String ALL = "cmis:all";
+
+    /**
+     * The technical name of the permission.
+     */
+    String getId();
+
+    /**
+     * The description for the permission, presented to the user.
+     */
+    String getDescription();
+
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Permission.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,76 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Which types of permissions are supported by a repository.
+ */
+public enum PermissionsSupported {
+
+    /**
+     * Basic permissions are supported.
+     */
+    BASIC("basic"),
+
+    /**
+     * Repository-specific permissions are supported.
+     */
+    REPOSITORY("repository"),
+
+    /**
+     * Both basic and repository-specific permissions are supported.
+     */
+    BOTH("both");
+
+    private final String value;
+
+    private PermissionsSupported(String value) {
+        this.value = value;
+    }
+
+    private static final Map<String, PermissionsSupported> all = new HashMap<String, PermissionsSupported>();
+    static {
+        for (PermissionsSupported o : values()) {
+            all.put(o.value, o);
+        }
+    }
+
+    public static PermissionsSupported get(String value) {
+        PermissionsSupported o = all.get(value);
+        if (o == null) {
+            throw new IllegalArgumentException(value);
+        }
+        return o;
+    }
+
+    public static PermissionsSupported get(String value,
+            PermissionsSupported def) {
+        PermissionsSupported o = all.get(value);
+        if (o == null) {
+            o = def;
+        }
+        return o;
+    }
+
+    @Override
+    public String toString() {
+        return value;
+    }
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PermissionsSupported.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java Sun Aug  2 23:23:22 2009
@@ -82,4 +82,9 @@
      */
     ChangeCapability getChangeCapability();
 
+    /**
+     * The level of support for ACLs.
+     */
+    ACLCapability getACLCapability();
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java Sun Aug  2 23:23:22 2009
@@ -67,6 +67,14 @@
     RepositoryCapabilities getCapabilities();
 
     /**
+     * The type of ACL capabilities of the repository.
+     * <p>
+     * Available only if {@link RepositoryCapabilities#getACLCapability} is not
+     * {@link ACLCapability#NONE}.
+     */
+    ACLCapabilityType getACLCapabilityType();
+
+    /**
      * The base types for which changes are reported by the change log.
      */
     Set<BaseType> getChangeLogBaseTypes();

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java Sun Aug  2 23:23:22 2009
@@ -749,10 +749,10 @@
      * <p>
      * The target object must be controllable.
      *
-     * @param policy the policy
      * @param object the target object
+     * @param policy the policy
      */
-    void applyPolicy(ObjectId policy, ObjectId object);
+    void applyPolicy(ObjectId object, ObjectId policy);
 
     /**
      * Removes a policy from an object.
@@ -761,11 +761,10 @@
      * not deleted, and may still be applied to other objects.
      * <p>
      * The target object must be controllable.
-     *
-     * @param policy the policy
      * @param object the target object
+     * @param policy the policy
      */
-    void removePolicy(ObjectId policy, ObjectId object);
+    void removePolicy(ObjectId object, ObjectId policy);
 
     /**
      * Gets the policies applied to an object.
@@ -781,4 +780,43 @@
      */
     Collection<ObjectEntry> getAppliedPolicies(ObjectId object, String filter);
 
+    /*
+     * ----- ACL services -----
+     */
+
+    /**
+     * Gets the ACL currently applied to the specified document or folder
+     * object.
+     * <p>
+     * The return value exact is {@code true} if the returned ACL fully
+     * describes the permissions for this object.
+     *
+     * @param object the object
+     * @param onlyBasicPermissions {@code true} if the result should be
+     *            expressed using only basic permissions
+     * @return the ACL
+     */
+    List<ACE> getACL(ObjectId object, boolean onlyBasicPermissions,
+            boolean[] exact);
+
+    /**
+     * Adds or removes the given ACEs to or from the ACL of the specified
+     * document or folder object.
+     * <p>
+     * The return value exact is {@code true} if the returned ACL fully
+     * describes the permissions for this object.
+     * <p>
+     * The return value changeToken, if not {@code null}, is a change token for
+     * the object.
+     *
+     * @param object the object
+     * @param addACEs the ACEs to add
+     * @param removeACEs the ACEs to remove
+     * @param propagation the ACL propagation to use
+     * @return the new ACL
+     */
+    List<ACE> applyACL(ObjectId object, List<ACE> addACEs,
+            List<ACE> removeACEs, ACLPropagation propagation, boolean[] exact,
+            String[] changeToken);
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java Sun Aug  2 23:23:22 2009
@@ -30,6 +30,8 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.chemistry.ACE;
+import org.apache.chemistry.ACLPropagation;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.CMISObject;
 import org.apache.chemistry.Connection;
@@ -570,12 +572,12 @@
      * ----- Policy Services -----
      */
 
-    public void applyPolicy(ObjectId policy, ObjectId object) {
+    public void applyPolicy(ObjectId object, ObjectId policy) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
 
-    public void removePolicy(ObjectId policy, ObjectId object) {
+    public void removePolicy(ObjectId object, ObjectId policy) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
@@ -586,4 +588,21 @@
         throw new UnsupportedOperationException();
     }
 
+    /*
+     * ----- ACL services -----
+     */
+
+    public List<ACE> getACL(ObjectId object, boolean onlyBasicPermissions,
+            boolean[] exact) {
+        // TODO Auto-generated method stub
+        return Collections.emptyList();
+    }
+
+    public List<ACE> applyACL(ObjectId object, List<ACE> addACEs,
+            List<ACE> removeACEs, ACLPropagation propagation, boolean[] exact,
+            String[] changeToken) {
+        // TODO Auto-generated method stub
+        throw new UnsupportedOperationException();
+    }
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryCapabilities.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryCapabilities.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryCapabilities.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryCapabilities.java Sun Aug  2 23:23:22 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.chemistry.atompub.client;
 
+import org.apache.chemistry.ACLCapability;
 import org.apache.chemistry.ChangeCapability;
 import org.apache.chemistry.JoinCapability;
 import org.apache.chemistry.QueryCapability;
@@ -35,6 +36,8 @@
 
     protected ChangeCapability changeCapability;
 
+    protected ACLCapability aclCapability;
+
     protected boolean hasUnfiling;
 
     protected boolean hasMultifiling;
@@ -65,6 +68,10 @@
         return changeCapability;
     }
 
+    public ACLCapability getACLCapability() {
+        return aclCapability;
+    }
+
     public boolean hasMultifiling() {
         return hasMultifiling;
     }
@@ -137,4 +144,8 @@
         this.changeCapability = changeCapability;
     }
 
+    public void setACLCapability(ACLCapability aclCapability) {
+        this.aclCapability = aclCapability;
+    }
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryInfo.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryInfo.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryInfo.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepositoryInfo.java Sun Aug  2 23:23:22 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.chemistry.ACLCapabilityType;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.ObjectId;
 import org.apache.chemistry.RepositoryCapabilities;
@@ -121,6 +122,11 @@
         return getString(CMIS.LATEST_CHANGE_LOG_TOKEN.getLocalPart());
     }
 
+    public ACLCapabilityType getACLCapabilityType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
     public Collection<RepositoryEntry> getRelatedRepositories() {
         throw new UnsupportedOperationException("Not yet implemented");
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java Sun Aug  2 23:23:22 2009
@@ -28,6 +28,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.chemistry.ACLCapability;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.ChangeCapability;
 import org.apache.chemistry.JoinCapability;
@@ -134,10 +135,12 @@
                                 RenditionCapability.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_CHANGES.getLocalPart())) {
                         caps.setChangeCapability(ChangeCapability.get(
-                                reader.getElementText(),
-                                ChangeCapability.NONE));
+                                reader.getElementText(), ChangeCapability.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_CHANGES_ON_TYPE.getLocalPart())) {
                         changeLogBaseTypes.add(BaseType.get(reader.getElementText()));
+                    } else if (localName.equals(CMIS.CAPABILITY_ACL.getLocalPart())) {
+                        caps.setACLCapability(ACLCapability.get(
+                                reader.getElementText(), ACLCapability.NONE));
                     }
                 }
             } else if (localName.equals(CMIS.REPOSITORY_SPECIFIC_INFORMATION.getLocalPart())) {

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java Sun Aug  2 23:23:22 2009
@@ -140,6 +140,7 @@
             write(CMIS.CAPABILITY_JOIN, cap.getJoinCapability().toString());
             write(CMIS.CAPABILITY_RENDITIONS,
                     cap.getRenditionCapability().toString());
+            write(CMIS.CAPABILITY_ACL, cap.getACLCapability().toString());
             write(CMIS.CAPABILITY_CHANGES, cap.getJoinCapability().toString());
             for (BaseType t : info.getChangeLogBaseTypes()) {
                 write(CMIS.CAPABILITY_CHANGES_ON_TYPE, t.toString());

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java Sun Aug  2 23:23:22 2009
@@ -93,8 +93,22 @@
 
     public static final QName CAPABILITY_CHANGES_ON_TYPE = CMISName("capabilityChangesOnType");
 
+    public static final QName CAPABILITY_ACL = CMISName("capabilityACL");
+
     public static final QName CHANGES_INCOMPLETE = CMISName("changesIncomplete");
 
+    public static final QName ACL_CAPABILITY = CMISName("aclCapability");
+
+    public static final QName SET_TYPE = CMISName("setType");
+
+    public static final QName PERMISSIONS = CMISName("permissions");
+
+    public static final QName MAPPING = CMISName("mapping");
+
+    public static final QName KEY = CMISName("key");
+
+    public static final QName PERMISSION = CMISName("permission");
+
     public static final QName VERSION_SUPPORTED = CMISName("cmisVersionSupported");
 
     public static final QName REPOSITORY_SPECIFIC_INFORMATION = CMISName("repositorySpecificInformation");

Added: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,53 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry.impl.simple;
+
+import org.apache.chemistry.ACE;
+
+public class SimpleACE implements ACE {
+
+    protected final String permission;
+
+    protected final String principal;
+
+    protected final boolean direct;
+
+    public SimpleACE(String permission, String principal, boolean direct) {
+        this.permission = permission;
+        this.principal = principal;
+        this.direct = direct;
+    }
+
+    public String getPermission() {
+        return permission;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public boolean isDirect() {
+        return direct;
+    }
+
+    @Override
+    public String toString() {
+        return this.getClass().getSimpleName() + '(' + permission + ','
+                + principal + ',' + direct + ')';
+    }
+
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleACE.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java Sun Aug  2 23:23:22 2009
@@ -36,6 +36,8 @@
 import org.antlr.runtime.TokenStream;
 import org.antlr.runtime.tree.CommonTree;
 import org.antlr.runtime.tree.CommonTreeNodeStream;
+import org.apache.chemistry.ACE;
+import org.apache.chemistry.ACLPropagation;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.CMISObject;
 import org.apache.chemistry.Connection;
@@ -723,12 +725,12 @@
      * ----- Policy Services -----
      */
 
-    public void applyPolicy(ObjectId policy, ObjectId object) {
+    public void applyPolicy(ObjectId object, ObjectId policy) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
 
-    public void removePolicy(ObjectId policy, ObjectId object) {
+    public void removePolicy(ObjectId object, ObjectId policy) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
@@ -739,4 +741,21 @@
         throw new UnsupportedOperationException();
     }
 
+    /*
+     * ----- ACL Services -----
+     */
+
+    public List<ACE> getACL(ObjectId object, boolean onlyBasicPermissions,
+            boolean[] exact) {
+        // TODO Auto-generated method stub
+        return Collections.emptyList();
+    }
+
+    public List<ACE> applyACL(ObjectId object, List<ACE> addACEs,
+            List<ACE> removeACEs, ACLPropagation propagation, boolean[] exact,
+            String[] changeToken) {
+        // TODO Auto-generated method stub
+        throw new UnsupportedOperationException();
+    }
+
 }

Added: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java?rev=800156&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java Sun Aug  2 23:23:22 2009
@@ -0,0 +1,81 @@
+/*
+ * Licensed 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.
+ *
+ * Authors:
+ *     Florent Guillaume, Nuxeo
+ */
+package org.apache.chemistry.impl.simple;
+
+import org.apache.chemistry.Permission;
+
+public class SimplePermission implements Permission {
+
+    public static final SimplePermission PERMISSION_READ = new SimplePermission(
+            Permission.READ, "Read");
+
+    public static final SimplePermission PERMISSION_WRITE = new SimplePermission(
+            Permission.WRITE, "Write");
+
+    public static final SimplePermission PERMISSION_DELETE = new SimplePermission(
+            Permission.DELETE, "Delete");
+
+    public static final SimplePermission PERMISSION_ALL = new SimplePermission(
+            Permission.ALL, "All");
+
+    protected final String id;
+
+    protected final String description;
+
+    protected SimplePermission(String id, String description) {
+        this.id = id;
+        this.description = description;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    @Override
+    public int hashCode() {
+        return id == null ? 31 : id.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof SimplePermission) {
+            return equals((SimplePermission) obj);
+        }
+        return false;
+    }
+
+    private boolean equals(SimplePermission other) {
+        if (id == null) {
+            return other.id == null;
+        } else {
+            return id.equals(other.id);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return this.getClass().getSimpleName() + '(' + id + ')';
+    }
+
+}

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePermission.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java Sun Aug  2 23:23:22 2009
@@ -26,6 +26,8 @@
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.chemistry.ACLCapability;
+import org.apache.chemistry.ACLCapabilityType;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.ChangeCapability;
 import org.apache.chemistry.Connection;
@@ -148,9 +150,15 @@
     }
 
     public String getLatestChangeLogToken() {
+        // TODO Auto-generated method stub
         return "";
     }
 
+    public ACLCapabilityType getACLCapabilityType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
     /*
      * ----- RepositoryCapabilities -----
      */
@@ -199,4 +207,8 @@
         return ChangeCapability.NONE;
     }
 
+    public ACLCapability getACLCapability() {
+        return ACLCapability.NONE;
+    }
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java Sun Aug  2 23:23:22 2009
@@ -33,6 +33,8 @@
 import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
 
+import org.apache.chemistry.ACE;
+import org.apache.chemistry.ACLPropagation;
 import org.apache.chemistry.CMISObject;
 import org.apache.chemistry.Connection;
 import org.apache.chemistry.ContentStream;
@@ -160,7 +162,7 @@
         throw new UnsupportedOperationException();
     }
 
-    public void applyPolicy(ObjectId policyId, ObjectId objectId) {
+    public void applyPolicy(ObjectId objectId, ObjectId policyId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
@@ -447,7 +449,7 @@
         throw new UnsupportedOperationException();
     }
 
-    public void removePolicy(ObjectId policyId, ObjectId objectId) {
+    public void removePolicy(ObjectId objectId, ObjectId policyId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
@@ -472,4 +474,17 @@
         return Collections.<ObjectEntry> emptyList().iterator();
     }
 
+    public List<ACE> getACL(ObjectId object, boolean onlyBasicPermissions,
+            boolean[] exact) {
+        // TODO Auto-generated method stub
+        return Collections.emptyList();
+    }
+
+    public List<ACE> applyACL(ObjectId object, List<ACE> addACEs,
+            List<ACE> removeACEs, ACLPropagation propagation, boolean[] exact,
+            String[] changeToken) {
+        // TODO Auto-generated method stub
+        throw new UnsupportedOperationException();
+    }
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java?rev=800156&r1=800155&r2=800156&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java Sun Aug  2 23:23:22 2009
@@ -31,6 +31,8 @@
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeManager;
 
+import org.apache.chemistry.ACLCapability;
+import org.apache.chemistry.ACLCapabilityType;
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.ChangeCapability;
 import org.apache.chemistry.Connection;
@@ -56,6 +58,7 @@
     private static final Log log = LogFactory.getLog(JcrRepository.class);
 
     private final javax.jcr.Repository repository;
+
     private final String workspace;
 
     public JcrRepository(javax.jcr.Repository repository, String workspace) {
@@ -74,7 +77,8 @@
 
     public Connection getConnection(Map<String, Serializable> parameters) {
         // TODO pass credentials as parameters
-        SimpleCredentials creds = new SimpleCredentials("admin", "admin".toCharArray());
+        SimpleCredentials creds = new SimpleCredentials("admin",
+                "admin".toCharArray());
 
         try {
             return new JcrConnection(repository.login(creds, workspace), this);
@@ -99,8 +103,8 @@
     public Type getType(String typeId) {
         try {
             // TODO pass credentials as parameters
-            SimpleCredentials creds = new SimpleCredentials("admin", "admin"
-                    .toCharArray());
+            SimpleCredentials creds = new SimpleCredentials("admin",
+                    "admin".toCharArray());
 
             Session session = repository.login(creds, workspace);
 
@@ -132,8 +136,8 @@
 
         try {
             // TODO pass credentials as parameters
-            SimpleCredentials creds = new SimpleCredentials("admin", "admin"
-                    .toCharArray());
+            SimpleCredentials creds = new SimpleCredentials("admin",
+                    "admin".toCharArray());
 
             List<Type> result = new ArrayList<Type>();
 
@@ -190,6 +194,11 @@
         return "";
     }
 
+    public ACLCapabilityType getACLCapabilityType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
     public String getDescription() {
         return getName();
     }
@@ -267,4 +276,9 @@
     public boolean isPWCUpdatable() {
         return false;
     }
+
+    public ACLCapability getACLCapability() {
+        // TODO Auto-generated method stub
+        return ACLCapability.NONE;
+    }
 }



Mime
View raw message