now using the simplified user management interface.
[utils] / security / impl / src / main / java / org / wamblee / security / authentication / UserAdminInitializer.java
index 2168d891c1522b8bb58b6043b4f7f20258f0149e..f716dfbdad9e720fa202f758653432e64ed59fc1 100644 (file)
@@ -71,20 +71,16 @@ public class UserAdminInitializer {
             String group = aGroups[i];
             String password = aPasswords[i];
 
-            if (aAdmin.getUser(user) == null) {
-                // must create user.
-                Group groupObj = aAdmin.getGroup(group);
-
-                if (groupObj == null) {
+            if (!aAdmin.checkUser(user)) {
+                if (!(aAdmin.checkGroup(group))) {
                     // must create group
                     LOGGER.info("Creating group: " + group);
-                    groupObj = aAdmin.createGroup(group);
+                    aAdmin.createGroup(group);
                 }
-                assert groupObj != null;
-
                 LOGGER
                     .info("Creating user: " + user + " password: " + password);
-                aAdmin.createUser(user, password, groupObj);
+                aAdmin.createUser(user, password);
+                aAdmin.addUserToGroup(user, group);
             }
         }
     }