cancel
Showing results for 
Search instead for 
Did you mean: 

how to remove all users in a given group

nick_l
Champ in-the-making
Champ in-the-making
hi guys,

I want to remove all users in a group, given I don't know who are currently in this group.

If I know the user, I can use following code to remove him from group:

accessControlService.removeChildAuthorities(groupId, new String[] {userId()});

But the problem is I don't know who are in this group.

Any idea?
1 REPLY 1

kaynezhang
World-Class Innovator
World-Class Innovator
You can use getChildAuthorities  to get all users belong to this group,and use removeChildAuthorities to remove users from group.
Or
You can use deleteAuthority to delete this group and recreate it.