jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1538643 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionUtil.java
Date Mon, 04 Nov 2013 15:11:29 GMT
Author: angela
Date: Mon Nov  4 15:11:29 2013
New Revision: 1538643

URL: http://svn.apache.org/r1538643
Log:
OAK-527: minor improvement (unused import, javadoc, unused methods)

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionUtil.java?rev=1538643&r1=1538642&r2=1538643&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionUtil.java
Mon Nov  4 15:11:29 2013
@@ -16,34 +16,25 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.permission;
 
-import java.security.Principal;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import com.google.common.base.Strings;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
-import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.core.ImmutableRoot;
 import org.apache.jackrabbit.oak.core.ImmutableTree;
 import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionConstants;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
-
-import com.google.common.base.Strings;
-import org.apache.jackrabbit.oak.util.TreeLocation;
 import org.apache.jackrabbit.util.Text;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * PermissionUtil... TODO
+ * Utility methods to evaluate permissions.
  */
 public final class PermissionUtil implements PermissionConstants {
 
-    private static final Logger log = LoggerFactory.getLogger(PermissionUtil.class);
-
     private PermissionUtil() {}
 
     @CheckForNull
@@ -87,12 +78,12 @@ public final class PermissionUtil implem
     }
 
     @Nonnull
-    public static Tree getPermissionsRoot(Root root, String workspaceName) {
+    public static Tree getPermissionsRoot(@Nonnull Root root, @Nonnull String workspaceName)
{
         return root.getTree(PERMISSIONS_STORE_PATH + '/' + workspaceName);
     }
 
     @Nonnull
-    public static Tree getPrincipalRoot(Tree permissionsTree, String principalName) {
+    public static Tree getPrincipalRoot(@Nonnull Tree permissionsTree, @Nonnull String principalName)
{
         return permissionsTree.getChild(Text.escapeIllegalJcrChars(principalName));
     }
 
@@ -101,23 +92,4 @@ public final class PermissionUtil implem
         // TODO: deal with hidden properties
         return tree.getType();
     }
-
-    @CheckForNull
-    public static TreeLocation createLocation(@Nonnull ImmutableRoot immutableRoot, @Nullable
String oakPath) {
-        if (oakPath != null && PathUtils.isAbsolute(oakPath)) {
-            return TreeLocation.create(immutableRoot, oakPath);
-        } else {
-            log.debug("Unable to create location for path " + oakPath);
-            return null;
-        }
-    }
-
-    @Nonnull
-    public static TreeLocation createLocation(@Nonnull Tree tree, @Nullable PropertyState
property) {
-        if (property == null) {
-            return TreeLocation.create(tree);
-        } else {
-            return TreeLocation.create(tree, property);
-        }
-    }
 }
\ No newline at end of file



Mime
View raw message