Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31139

REST API group endpoint to add a user returns a user instead of a group

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2021.22
    • Fix Version/s: None
    • Component/s: Rest API

      Description

      Steps to reproduce:

      1. Create user user1 and groups group1 and group2

      2. Add user1 to group1 via user endpoint (for comparison):
      Request:

      curl -X POST "http://localhost:8080/nuxeo/api/v1/user/user1/group/group1" -u "admin:admin" -d ''
      

      Response:

      {"entity-type":"user","id":"user1","properties":{"firstName":"","lastName":"","tenantId":null,"groups":["group1"],"company":"","email":"user1@example.com","username":"user1"},"extendedGroups":[{"name":"group1","label":"","url":"group/group1"}],"isAdministrator":false,"isAnonymous":false}
      

      3. Add user1 to group2 via group endpoint:
      Request:

      curl -X POST "http://localhost:8080/nuxeo/api/v1/group/group2/user/user1" -u "admin:admin" -d ''
      

      Response:

      {"entity-type":"user","id":"user1","properties":{"firstName":"","lastName":"","tenantId":null,"groups":["group1","group2"],"company":"","email":"user1@example.com","username":"user1"},"extendedGroups":[{"name":"group1","label":"","url":"group/group1"},{"name":"group2","label":"","url":"group/group2"}],"isAdministrator":false,"isAnonymous":false}
      

      Expected result:

      • A group entity is returned

      Actual result:

      • A user entity is returned

      See:

      https://doc.nuxeo.com/rest-api/1/user-endpoint/#add-a-user-to-a-group

      https://doc.nuxeo.com/rest-api/1/group-endpoint/#add-a-user-to-a-group

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              msaye Mark Saye
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: