jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1535371 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java
Date Thu, 24 Oct 2013 13:12:41 GMT
Author: angela
Date: Thu Oct 24 13:12:41 2013
New Revision: 1535371

URL: http://svn.apache.org/r1535371
Log:
OAK-1115 : add test case and list as known issue

Modified:
    jackrabbit/oak/trunk/oak-jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1535371&r1=1535370&r2=1535371&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Thu Oct 24 13:12:41 2013
@@ -108,6 +108,7 @@
 
       <!-- Permission Evaluation -->
       org.apache.jackrabbit.oak.jcr.security.authorization.WriteTest#testWriteOnParentWithNoReadePriv<!--
OAK-869 -->
+      org.apache.jackrabbit.oak.jcr.security.authorization.WriteTest#testMoveRemoveSubTree
          <!-- OAK-1115 blocked by OAK-783 -->
 
       org.apache.jackrabbit.oak.jcr.security.authorization.VersionManagementTest#testRemoveVersion
  <!-- OAK-168 -->
       org.apache.jackrabbit.oak.jcr.security.authorization.VersionManagementTest#testRemoveVersion2
 <!-- OAK-168 -->

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java?rev=1535371&r1=1535370&r2=1535371&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/WriteTest.java
Thu Oct 24 13:12:41 2013
@@ -837,4 +837,33 @@ public class WriteTest extends AbstractE
             superuser.save();
         }
     }
+
+    @Ignore("OAK-1115")
+    @Test
+    public void testMoveRemoveSubTree() throws Exception {
+        Node subtree = superuser.getNode(childNPath).addNode(nodeName3);
+        superuser.save();
+
+        String subtreePath = subtree.getPath();
+
+        /* allow READ/WRITE privilege for testUser at 'path' */
+        allow(path, testUser.getPrincipal(), readWritePrivileges);
+        /* deny READ/REMOVE property privileges at subtree. */
+        deny(path, privilegesFromNames(new String[] {PrivilegeConstants.JCR_REMOVE_NODE}),
createGlobRestriction("*/"+nodeName3));
+
+        assertTrue(testSession.nodeExists(childNPath));
+        assertTrue(testSession.hasPermission(childNPath, Session.ACTION_REMOVE));
+        assertTrue(testSession.hasPermission(childNPath2, Session.ACTION_ADD_NODE));
+
+        testSession.move(childNPath, childNPath2 + "/dest");
+        Node dest = testSession.getNode(childNPath2 + "/dest");
+        dest.getNode(nodeName3).remove();
+
+        try {
+            testSession.save();
+            fail("Removing child node must be denied.");
+        } catch (AccessDeniedException e) {
+            // success
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message