jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1466108 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core: RootImpl.java TreeImpl.java
Date Tue, 09 Apr 2013 16:35:53 GMT
Author: mduerig
Date: Tue Apr  9 16:35:53 2013
New Revision: 1466108

URL: http://svn.apache.org/r1466108
Log:
OAK-709: Consider moving permission evaluation to the node state level
fix getPropertyStatus

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1466108&r1=1466107&r2=1466108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Tue Apr  9 16:35:53 2013
@@ -233,7 +233,7 @@ public class RootImpl implements Root {
     @Override
     public void rebase() {
         checkLive();
-        if (!store.getRoot().equals(rootTree.getBaseState())) {
+        if (!store.getRoot().equals(getBaseState())) {
             purgePendingChanges();
             branch.rebase();
             reset();
@@ -408,20 +408,20 @@ public class RootImpl implements Root {
     }
 
     @Nonnull
-    PermissionProvider getPermissionProvider() {
-        if (permissionProvider == null) {
-            permissionProvider = createPermissionProvider();
-        }
-        return permissionProvider;
-    }
-
-    @Nonnull
     String getWorkspaceName() {
         return workspaceName;
     }
 
     //------------------------------------------------------------< private >---
 
+    @Nonnull
+    private PermissionProvider getPermissionProvider() {
+        if (permissionProvider == null) {
+            permissionProvider = createPermissionProvider();
+        }
+        return permissionProvider;
+    }
+
     /**
      * Purge all pending changes to the underlying {@link NodeStoreBranch}.
      */

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=1466108&r1=1466107&r2=1466108&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
Tue Apr  9 16:35:53 2013
@@ -147,8 +147,7 @@ public class TreeImpl implements Tree {
             return null;
         }
 
-        // FIXME: This should be based on the secure base state
-        NodeState parentBase = getBaseState();
+        NodeState parentBase = getSecureBase();
         PropertyState base = parentBase.getProperty(name);
 
         if (base == null) {
@@ -412,19 +411,6 @@ public class TreeImpl implements Tree {
 
     //-----------------------------------------------------------< internal >---
 
-    /**
-     * The (possibly non-existent) node state this tree is based on.
-     * @return the base node state of this tree
-     */
-    @Nonnull
-    final NodeState getBaseState() {
-        if (parent == null) {
-            return root.getBaseState();
-        } else {
-            return parent.getBaseState().getChildNode(name);
-        }
-    }
-
     @Nonnull
     NodeState getNodeState() {
         return nodeBuilder.getNodeState();
@@ -530,6 +516,19 @@ public class TreeImpl implements Tree {
         applyPendingMoves();
     }
 
+    /**
+     * The (possibly non-existent) node state this tree is based on.
+     * @return the base node state of this tree
+     */
+    @Nonnull
+    private NodeState getSecureBase() {
+        if (parent == null) {
+            return root.getSecureBase();
+        } else {
+            return parent.getSecureBase().getChildNode(name);
+        }
+    }
+
     private void applyPendingMoves() {
         if (parent != null) {
             parent.applyPendingMoves();



Mime
View raw message