UserManager - createGroup not working | Community
Skip to main content
crich2784
New Participant
May 24, 2022
Solved

UserManager - createGroup not working

  • May 24, 2022
  • 1 reply
  • 531 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by crich2784

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.  

1 reply

crich2784
crich2784AuthorAccepted solution
New Participant
May 24, 2022

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.