jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1557993 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/SessionMoveTest.java
Date Tue, 14 Jan 2014 09:34:36 GMT
Author: angela
Date: Tue Jan 14 09:34:35 2014
New Revision: 1557993

URL: http://svn.apache.org/r1557993
Log:
OAK-710 : PermissionValidator: Proper permission evaluation for moving/renaming nodes (wip)

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/SessionMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/SessionMoveTest.java?rev=1557993&r1=1557992&r2=1557993&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/SessionMoveTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/SessionMoveTest.java
Tue Jan 14 09:34:35 2014
@@ -280,29 +280,28 @@ public class SessionMoveTest extends Abs
         testSession.save();
     }
 
-    // FIXME: adding replacement is not detected by node state diff.
-//    @Test
-//    public void testMoveAndAddReplacementAtSource() throws Exception {
-//        allow(path, privilegesFromNames(new String[]{
-//                Privilege.JCR_REMOVE_CHILD_NODES, Privilege.JCR_ADD_CHILD_NODES
-//        }));
-//        allow(siblingPath, privilegesFromNames(new String[] {
-//                PrivilegeConstants.JCR_ADD_CHILD_NODES, PrivilegeConstants.JCR_NODE_TYPE_MANAGEMENT
-//        }));
-//
-//        testSession.move(nodePath3, siblingDestPath);
-//
-//        Node sourceParent = testSession.getNode(childNPath);
-//        Node replacement = sourceParent.addNode(Text.getName(nodePath3));
-//        replacement.setProperty("movedProp", "val");
-//
-//        try {
-//            testSession.save();
-//            fail("Missing ADD_NODE and ADD_PROPERTY permission on source parent.");
-//        } catch (AccessDeniedException e) {
-//            // success
-//        }
-//    }
+    @Test
+    public void testMoveAndAddReplacementAtSource() throws Exception {
+        allow(path, privilegesFromNames(new String[]{
+                Privilege.JCR_REMOVE_CHILD_NODES, Privilege.JCR_ADD_CHILD_NODES
+        }));
+        allow(siblingPath, privilegesFromNames(new String[] {
+                PrivilegeConstants.JCR_ADD_CHILD_NODES, PrivilegeConstants.JCR_NODE_TYPE_MANAGEMENT
+        }));
+
+        testSession.move(nodePath3, siblingDestPath);
+
+        Node sourceParent = testSession.getNode(childNPath);
+        Node replacement = sourceParent.addNode(Text.getName(nodePath3));
+        replacement.setProperty("movedProp", "val");
+
+        try {
+            testSession.save();
+            fail("Missing ADD_NODE and ADD_PROPERTY permission on source parent.");
+        } catch (AccessDeniedException e) {
+            // success
+        }
+    }
 
     @Test
     public void testMoveAndAddReplacementAtSource2() throws Exception {



Mime
View raw message