jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1374992 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
Date Mon, 20 Aug 2012 12:27:06 GMT
Author: mduerig
Date: Mon Aug 20 12:27:06 2012
New Revision: 1374992

URL: http://svn.apache.org/viewvc?rev=1374992&view=rev
Log:
OAK-259: Issues in o.a.j.oak.security.user.UserProviderImpl
thanks Chetan Mehrotra for the patch

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java?rev=1374992&r1=1374991&r2=1374992&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
Mon Aug 20 12:27:06 2012
@@ -24,6 +24,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import javax.annotation.Nullable;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -177,7 +178,7 @@ public class UserProviderImpl implements
         this.identifierManager = new IdentifierManager(contentSession, root);
 
         defaultDepth = config.getConfigValue(UserManagerConfig.PARAM_DEFAULT_DEPTH, DEFAULT_DEPTH);
-        int splitValue = config.getConfigValue(UserManagerConfig.PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE,
0);
+        int splitValue = config.getConfigValue(UserManagerConfig.PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE,
4);
         if (splitValue < 4) {
             log.warn("Invalid value {} for {}. Expected integer >= 4", splitValue, UserManagerConfig.PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE);
             splitValue = 0;
@@ -463,7 +464,7 @@ public class UserProviderImpl implements
 
     private boolean isAuthorizableTree(Tree tree, int type) {
         // FIXME: check for node type according to the specified type constraint
-        if (tree.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) {
+        if (tree != null && tree.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) {
             String ntName = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE).getValue().getString();
             switch (type) {
                 case UserManager.SEARCH_TYPE_GROUP:
@@ -512,7 +513,7 @@ public class UserProviderImpl implements
         NodeUtil folder;
         Tree authTree = root.getTree(authRoot);
         if (authTree == null) {
-            folder = new NodeUtil(root.getTree(""), contentSession);
+            folder = new NodeUtil(root.getTree("/"), contentSession);
             for (String name : Text.explode(authRoot, '/', false)) {
                 folder = folder.getOrAddChild(name, NT_REP_AUTHORIZABLE_FOLDER);
             }



Mime
View raw message