Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

I need Group id of a Closed user group.

Avatar

Level 1

Can i get the groupid of CUG.I can  get group name like(content-author,dsc,...etc,).but I need groupId of that group.Please let me know how can I get groupId.Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

Can you try this

Session adminSession = resourceResolver.adaptTo(Session.class);

UserManager um = AccessControlUtil.getUserManager(adminSession);

um.getAuthorizable("Group_Name").getID();

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

Can you try this

Session adminSession = resourceResolver.adaptTo(Session.class);

UserManager um = AccessControlUtil.getUserManager(adminSession);

um.getAuthorizable("Group_Name").getID();