Expand my Community achievements bar.

SOLVED

UserManager - createGroup not working

Avatar

Level 7

We have created a custom component to create a Security group.  The code is below.

The code completes successfully with no errors but, the security group is not created.

Any help would be appreciated.

 

log.info(" Creating the group in AEM - " + groupNameToCreate);
userManager.autoSave(true); -- added later to test
Group newGroup = userManager.createGroup(groupNameToCreate);
userIterator = authorizables.iterator();
while (userIterator.hasNext()) {
   Authorizable user = userIterator.next();
   log.info(" Adding AEM user " + user.getID() + " to group.");
   newGroup.addMember(user);
}
adminSession.save();  --added later to test.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Nevermind - it works.  I forgot to deploy after writing the save.  I put save after each change and I removed autoSave.  Apparently you can't autoSave and save together or something.  

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

Nevermind - it works.  I forgot to deploy after writing the save.  I put save after each change and I removed autoSave.  Apparently you can't autoSave and save together or something.