jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1531206 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
Date Fri, 11 Oct 2013 07:28:30 GMT
Author: angela
Date: Fri Oct 11 07:28:30 2013
New Revision: 1531206

URL: http://svn.apache.org/r1531206
Log:
OAK-527: testing accessibility of version information if versionable node is removed

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java?rev=1531206&r1=1531205&r2=1531206&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/VersionManagementTest.java
Fri Oct 11 07:28:30 2013
@@ -295,6 +295,42 @@ public class VersionManagementTest exten
      * @since oak
      */
     @Test
+    public void testAccessVersionHistoryVersionableNodeRemoved() throws Exception {
+        Node n = createVersionableNode(superuser.getNode(path));
+        allow(n.getPath(), versionPrivileges);
+
+        n.checkin();
+        n.checkout();
+
+        String versionablePath = n.getPath();
+        VersionHistory vh = n.getVersionHistory();
+        String vhPath = vh.getPath();
+        String vhUUID = vh.getIdentifier();
+
+        // remove the versionable node
+        n.remove();
+        superuser.save();
+
+        testSession.refresh(false);
+        assertTrue(testSession.nodeExists(path));
+        assertFalse(testSession.nodeExists(versionablePath));
+
+        // accessing the version history directly should still succeed as
+        // read permission is still granted on the tree defined by the parent.
+        VersionHistory history = (VersionHistory) testSession.getNode(vhPath);
+        history = (VersionHistory) testSession.getNodeByIdentifier(vhUUID);
+        history = (VersionHistory) testSession.getNodeByUUID(vhUUID);
+
+        // revoking read permission on the parent node -> version history
+        // must no longer be accessible
+        modify(path, Privilege.JCR_READ, false);
+        assertFalse(testSession.nodeExists(vhPath));
+    }
+
+    /**
+     * @since oak
+     */
+    @Test
     public void testAddVersionLabel() throws Exception {
         Node n = createVersionableNode(superuser.getNode(path));
         allow(n.getPath(), versionPrivileges);



Mime
View raw message