jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1482588 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/authorization/permission/ test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/
Date Tue, 14 May 2013 20:55:19 GMT
Author: angela
Date: Tue May 14 20:55:18 2013
New Revision: 1482588

URL: http://svn.apache.org/r1482588
Log:
OAK-527: permissions (wip, clean up)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java?rev=1482588&r1=1482587&r2=1482588&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionValidator.java
Tue May 14 20:55:18 2013
@@ -103,8 +103,7 @@ class PermissionValidator extends Defaul
             child = getVersionHistoryTree(child);
             if (child == null) {
                 throw new CommitFailedException(
-                        ACCESS, 21,
-                        "New version storage node without version history: cannot verify
permissions.");
+                        ACCESS, 21, "New version storage node without version history: cannot
verify permissions.");
             }
         }
         return checkPermissions(child, false, Permissions.ADD_NODE);
@@ -115,9 +114,6 @@ class PermissionValidator extends Defaul
     public Validator childNodeChanged(String name, NodeState before, NodeState after) throws
CommitFailedException {
         Tree childBefore = parentBefore.getChild(name);
         Tree childAfter = parentAfter.getChild(name);
-
-        // TODO
-
         return nextValidator(childBefore, childAfter);
     }
 
@@ -125,10 +121,8 @@ class PermissionValidator extends Defaul
     public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException
{
         Tree child = checkNotNull(parentBefore.getChild(name));
         if (isVersionstorageTree(child)) {
-            // TODO: check again
             throw new CommitFailedException(
-                    ACCESS, 22,
-                    "Attempt to remove versionstorage node: Fail to verify delete permission.");
+                    ACCESS, 22, "Attempt to remove versionstorage node: Fail to verify delete
permission.");
         }
         return checkPermissions(child, true, Permissions.REMOVE_NODE);
     }
@@ -225,7 +219,7 @@ class PermissionValidator extends Defaul
         } else if (JcrConstants.JCR_MIXINTYPES.equals(name)) {
             perm = Permissions.NODE_TYPE_MANAGEMENT;
         } else if (JcrConstants.JCR_UUID.equals(name)) {
-            // TODO OAK-796: jcr:uuid is never set using a method on JCR API -> omit permission
check
+            // TODO: OAK-796 (jcr:uuid is never set using a method on JCR API -> omit
permission check)
             perm = Permissions.NO_PERMISSION;
         } else if (isLockProperty(name)) {
             perm = Permissions.LOCK_MANAGEMENT;
@@ -257,13 +251,11 @@ class PermissionValidator extends Defaul
         }
     }
 
-    // TODO
     private boolean isVersionstorageTree(Tree tree) {
         return permission == Permissions.VERSION_MANAGEMENT &&
                 VersionConstants.REP_VERSIONSTORAGE.equals(TreeUtil.getPrimaryTypeName(tree));
     }
 
-    // TODO
     private Tree getVersionHistoryTree(Tree versionstorageTree) throws CommitFailedException
{
         Tree versionHistory = null;
         for (Tree child : versionstorageTree.getChildren()) {
@@ -272,7 +264,6 @@ class PermissionValidator extends Defaul
             } else if (isVersionstorageTree(child)) {
                 versionHistory = getVersionHistoryTree(child);
             } else {
-                // TODO:
                 throw new CommitFailedException("Misc", 0, "unexpected node");
             }
         }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java?rev=1482588&r1=1482587&r2=1482588&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/ChildOrderPropertyTest.java
Tue May 14 20:55:18 2013
@@ -16,11 +16,6 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.evaluation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 import java.util.Set;
 
 import com.google.common.collect.Sets;
@@ -31,10 +26,13 @@ import org.apache.jackrabbit.oak.core.Tr
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Test for the hidden {@link TreeImpl#OAK_CHILD_ORDER} property
- *
- * TODO: review if this shouldn't be moved to o.a.jackrabbit.oak.core tests.
  */
 public class ChildOrderPropertyTest extends AbstractOakCoreTest {
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java?rev=1482588&r1=1482587&r2=1482588&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/evaluation/HiddenTreeTest.java
Tue May 14 20:55:18 2013
@@ -16,19 +16,17 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.evaluation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
 import org.apache.jackrabbit.oak.api.Tree;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Test to make sure hidden trees are never exposed.
- *
- * TODO: review if this should rather be moved to o.a.jackrabbit.oak.core tests.
  */
 public class HiddenTreeTest extends AbstractOakCoreTest {
 



Mime
View raw message