• 0
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      The only way one can get all the members of a particular group is to iterate through all the active users and then use hasGroup function,
      we need a function with a signature

      getGroupMembers(String token, String groupName)

            [CONFSERVER-5358] XML RPC Group/User Management Functions

            This would help us as well: the method mentioned by Tal Abramson above is pretty slow when you have lots of users. I've got about 3,000 users and a single pass over all of the users takes 4-5 minutes.

            We are running Confluence 3.2.

            Les LaCroix added a comment - This would help us as well: the method mentioned by Tal Abramson above is pretty slow when you have lots of users. I've got about 3,000 users and a single pass over all of the users takes 4-5 minutes. We are running Confluence 3.2.

            Linh Pham added a comment - - edited

            The XMLRPC doc (http://confluence.atlassian.com/display/CONFEXT/Perl+XML-RPC+client) mentions the method getUserGroups available in the perl module Confluence.pm; but it does not exist.

            Please add method to library or remove reference to documentation.

            Note: i'm running on Confluence 3.0.2

            Linh Pham added a comment - - edited The XMLRPC doc ( http://confluence.atlassian.com/display/CONFEXT/Perl+XML-RPC+client ) mentions the method getUserGroups available in the perl module Confluence.pm; but it does not exist. Please add method to library or remove reference to documentation. Note: i'm running on Confluence 3.0.2

            Miles Egan added a comment -

            This one would help us a lot too, particularly since we have to manage our group memberships manually via the API instead of directly through ldap because of the lack of support for nested ldap groups in confluence.

            Miles Egan added a comment - This one would help us a lot too, particularly since we have to manage our group memberships manually via the API instead of directly through ldap because of the lack of support for nested ldap groups in confluence.

            Tal Abramson added a comment - - edited

            This is how i do it for now - manage it locally:

            private HashMap groupsMembers;

            protected void buildGroupMembersList() throws RemoteException {
            LOGGER.debug("Building Groups Members list map");
            ConfluenceSoapService soapService = getService();
            String token = getToken();
            String[] allGroups = soapService.getGroups(token);
            for (String group : allGroups)

            { groupsMembers.put(group,new ArrayList<String>()); }

            String[] activeUsers = soapService.getActiveUsers(token, true);
            for (String user : activeUsers) {
            String[] userGroups = soapService.getUserGroups(token, user);
            for (String group : userGroups)

            { //for each group in user groups , add the user to the group Array in the Map ((ArrayList<String>)groupsMembers.get(group)).add(user); }

            }
            LOGGER.debug("Finished building map");
            }

            public void addGroupMember(String group,String user){
            ArrayList<String> members = ((ArrayList<String>)groupsMembers.get(group));
            if (members!=null)

            { members.add(user); }

            else

            { //there's no group in the map , add it members = new ArrayList<String>(); members.add(user); groupsMembers.put(group,members); }

            }

            protected String[] getGroupMembers(String groupName) throws RemoteException

            { ArrayList<String> users = (ArrayList<String>) groupsMembers.get(groupName); return users.toArray(new String[users.size()]); }

            Tal Abramson added a comment - - edited This is how i do it for now - manage it locally: private HashMap groupsMembers; protected void buildGroupMembersList() throws RemoteException { LOGGER.debug("Building Groups Members list map"); ConfluenceSoapService soapService = getService(); String token = getToken(); String[] allGroups = soapService.getGroups(token); for (String group : allGroups) { groupsMembers.put(group,new ArrayList<String>()); } String[] activeUsers = soapService.getActiveUsers(token, true); for (String user : activeUsers) { String[] userGroups = soapService.getUserGroups(token, user); for (String group : userGroups) { //for each group in user groups , add the user to the group Array in the Map ((ArrayList<String>)groupsMembers.get(group)).add(user); } } LOGGER.debug("Finished building map"); } public void addGroupMember(String group,String user){ ArrayList<String> members = ((ArrayList<String>)groupsMembers.get(group)); if (members!=null) { members.add(user); } else { //there's no group in the map , add it members = new ArrayList<String>(); members.add(user); groupsMembers.put(group,members); } } protected String[] getGroupMembers(String groupName) throws RemoteException { ArrayList<String> users = (ArrayList<String>) groupsMembers.get(groupName); return users.toArray(new String[users.size()]); }

            Hi Amit,

            Thanks for this suggestion. We will try and address this in a future version.

            Jeremy

            Jeremy Higgs added a comment - Hi Amit, Thanks for this suggestion. We will try and address this in a future version. Jeremy

              Unassigned Unassigned
              27ac41590cc4 Amit Kumar
              Votes:
              14 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: