jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1683155 - in /jackrabbit/commons/filevault/trunk/vault-core/src: main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java
Date Tue, 02 Jun 2015 18:35:33 GMT
Author: tripod
Date: Tue Jun  2 18:35:32 2015
New Revision: 1683155

URL: http://svn.apache.org/r1683155
Log:
JCRVLT-94 [AccessControlHandling] Unexpected behavior of acHandling 'merge'

Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java
    jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java?rev=1683155&r1=1683154&r2=1683155&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/JackrabbitACLImporter.java
Tue Jun  2 18:35:32 2015
@@ -222,6 +222,18 @@ public class JackrabbitACLImporter imple
                     (accessControlledPath == null ? "'root'" : accessControlledPath));
         }
 
+        // clear all ACEs of the package principals for merge (VLT-94), otherwise the `acl.addEntry()`
below
+        // might just combine the privileges.
+        if (aclHandling == AccessControlHandling.MERGE) {
+            for (String name: aceMap.keySet()) {
+                for (AccessControlEntry ace : acl.getAccessControlEntries()) {
+                    if (ace.getPrincipal().getName().equals(name)) {
+                        acl.removeAccessControlEntry(ace);
+                    }
+                }
+            }
+        }
+
         // apply ACEs of package
         for (Map.Entry<String, List<ACE>> entry: aceMap.entrySet()) {
             final String principalName = entry.getKey();

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java?rev=1683155&r1=1683154&r2=1683155&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestACLAndMerge.java
Tue Jun  2 18:35:32 2015
@@ -145,7 +145,6 @@ public class TestACLAndMerge extends Int
      * existing ACL.
      */
     @Test
-    @Ignore("JCRVLT-94")
     public void testACMerge4() throws RepositoryException, IOException, PackageException
{
         assertNodeMissing("/testroot");
 



Mime
View raw message