jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1452956 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
Date Tue, 05 Mar 2013 19:23:11 GMT
Author: alexparvulescu
Date: Tue Mar  5 19:23:11 2013
New Revision: 1452956

URL: http://svn.apache.org/r1452956
Log:
OAK-443 UserInitializer causes repository traversal

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java?rev=1452956&r1=1452955&r2=1452956&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
Tue Mar  5 19:23:11 2013
@@ -104,11 +104,18 @@ public class UserInitializer implements 
         try {
             NodeUtil rootTree = checkNotNull(new NodeUtil(root.getTree("/")));
             NodeUtil index = rootTree.getOrAddChild(IndexConstants.INDEX_DEFINITIONS_NAME,
JcrConstants.NT_UNSTRUCTURED);
-            IndexUtils.createIndexDefinition(index, "authorizableId", true, new String[]{REP_AUTHORIZABLE_ID},
null);
-            IndexUtils.createIndexDefinition(index, "principalName", true,
-                    new String[]{REP_PRINCIPAL_NAME},
-                    new String[]{NT_REP_GROUP, NT_REP_USER});
-            IndexUtils.createIndexDefinition(index, "members", false, new String[]{UserConstants.REP_MEMBERS},
null);
+
+            if (!index.hasChild("authorizableId")) {
+                IndexUtils.createIndexDefinition(index, "authorizableId", true, new String[]{REP_AUTHORIZABLE_ID},
null);
+            }
+            if (!index.hasChild("principalName")) {
+                IndexUtils.createIndexDefinition(index, "principalName", true,
+                        new String[]{REP_PRINCIPAL_NAME},
+                        new String[]{NT_REP_GROUP, NT_REP_USER});
+            }
+            if (!index.hasChild("members")) {
+                IndexUtils.createIndexDefinition(index, "members", false, new String[]{UserConstants.REP_MEMBERS},
null);
+            }
 
             String adminId = userConfiguration.getConfigurationParameters().getConfigValue(PARAM_ADMIN_ID,
DEFAULT_ADMIN_ID);
             if (userManager.getAuthorizable(adminId) == null) {



Mime
View raw message