jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1401594 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/TreeImpl.java test/java/org/apache/jackrabbit/oak/api/TreeTest.java
Date Wed, 24 Oct 2012 09:21:39 GMT
Author: mreutegg
Date: Wed Oct 24 09:21:38 2012
New Revision: 1401594

URL: http://svn.apache.org/viewvc?rev=1401594&view=rev
Log:
OAK-169: Support orderable nodes
- do not expose :childOrder property

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1401594&r1=1401593&r2=1401594&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Wed Oct 24 09:21:38 2012
@@ -38,6 +38,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
+import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
 import org.apache.jackrabbit.oak.spi.state.PropertyBuilder;
 
 import com.google.common.base.Function;
@@ -546,7 +547,9 @@ public class TreeImpl implements Tree, P
     private boolean canRead(PropertyState property) {
         // FIXME: access control eval must have full access to the tree/property
         // FIXME: special handling for access control item and version content
-        return (property != null) && root.getPermissions().canRead(this, property);
+        return (property != null)
+                && root.getPermissions().canRead(this, property)
+                && !NodeStateUtils.isHidden(property.getName());
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java?rev=1401594&r1=1401593&r2=1401594&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/TreeTest.java
Wed Oct 24 09:21:38 2012
@@ -34,6 +34,7 @@ import com.google.common.collect.Sets;
 import static org.apache.jackrabbit.oak.OakAssert.assertSequence;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Contains tests related to {@link Tree}
@@ -98,8 +99,9 @@ public class TreeTest {
             t = r.getTree("/");
             assertSequence(t.getChildren(), "node3", "node2", "node1");
 
-            // TODO :childOrder property invisible?
-            //assertEquals("must not have any properties", 0, t.getPropertyCount());
+            // :childOrder property invisible?
+            assertTrue(t.getProperty(":childOrder") == null);
+            assertEquals("must not have any properties", 0, t.getPropertyCount());
         } finally {
             s.close();
         }



Mime
View raw message