jackrabbit-oak-commits mailing list archives

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

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

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.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=1466107&r1=1466106&r2=1466107&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:40 2013
@@ -319,8 +319,7 @@ public class RootImpl implements Root {
     @Override
     public boolean hasPendingChanges() {
         checkLive();
-        // FIXME comparing insecure base state with secure root state
-        return !getBaseState().equals(getRootState());
+        return !getSecureBase().equals(getRootState());
     }
 
     @Nonnull
@@ -391,6 +390,15 @@ public class RootImpl implements Root {
         return branch.getBase();
     }
 
+    /**
+     * Returns the secure view of the base state from which the current branch was creates.
+     *
+     * @return secure base node state
+     */
+    NodeState getSecureBase() {
+        return new SecureNodeState(branch.getBase(), getPermissionProvider(), getTypeProvider());
+    }
+
     // TODO better way to determine purge limit. See OAK-175
     void updated() {
         if (++modCount > PURGE_LIMIT) {



Mime
View raw message