jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1569386 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java
Date Tue, 18 Feb 2014 15:30:11 GMT
Author: angela
Date: Tue Feb 18 15:30:11 2014
New Revision: 1569386

URL: http://svn.apache.org/r1569386
Log:
minor improvement: use PathUtils.elements to avoid empty segments

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java?rev=1569386&r1=1569385&r2=1569386&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/MoveAwarePermissionValidator.java
Tue Feb 18 15:30:11 2014
@@ -21,6 +21,7 @@ import javax.annotation.Nullable;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.ImmutableRoot;
 import org.apache.jackrabbit.oak.plugins.tree.ImmutableTree;
 import org.apache.jackrabbit.oak.spi.commit.EditorDiff;
@@ -77,7 +78,7 @@ public class MoveAwarePermissionValidato
         // TODO improve: avoid calculating the 'before' permissions in case the current parent
permissions already point to the correct tree.
         ImmutableTree parent = moveCtx.rootBefore.getTree("/");
         TreePermission tp = getPermissionProvider().getTreePermission(parent, TreePermission.EMPTY);
-        for (String n : source.getPath().split("/")) {
+        for (String n : PathUtils.elements(source.getPath())) {
             tp = tp.getChildPermission(n, parent.getChild(n).getNodeState());
         }
         Validator validator = createValidator(source, dest, tp, this);



Mime
View raw message