Uploaded image for project: 'Nuxeo Java Client'
  1. Nuxeo Java Client
  2. JAVACLIENT-139

Implement a way to retrieve users and groups for a group

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 3.0.0
    • Component/s: REST

      Description

      Group#getMemberUsers returns null.

      Cause could be that HTTP GET on api/v1/group/{groupname} does not return users member of the group.

          	UserManager userManager = nuxeoClient.getUserManager();
          	// create group
          	Group group = new Group();
          	group.setGroupName(groupName);
          	group.setGroupLabel(groupName);
          	Group nuxeoGroup = userManager.createGroup(group);
          	System.out.println("Group " + nuxeoGroup.getGroupName() + " created");
          	// create user
          	User newUser = new User();
          	newUser.setUserName(userName);
          	newUser.setCompany("Nuxeo");
          	newUser.setEmail(userName + "@nuxeo.com");
          	newUser.setFirstName("to");
          	newUser.setLastName("to");
          	newUser.setPassword(userName);
          	User userObj = userManager.createUser(newUser);
          	System.out.println("User " + userObj.getUserName() + " created");
          	// add user to group
          	User user = userManager.addUserToGroup(userName, groupName);
          	System.out.println("User " + user.getUserName() + " added to group " + groupName);
          	// fetch group
          	Group fetchedGroup = userManager.fetchGroup(groupName);
          	System.out.println("Fetch group members of group " + fetchedGroup.getGroupName() + ": " + fetchedGroup.getMemberUsers());
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h