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

Updating a group through the REST API resets the fields that are not passed in the JSON object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.10-HF19, 9.3
    • Component/s: Rest API

      Description

      For instance, the parent groups are reset il updating a group without passing the "parentGroups" property:

      1. Create a "parent" group
        http -a Administrator:Administrator POST http://localhost:8080/nuxeo/api/v1/groups entity-type=group id=parent
        
      2. Create a "child" group with "parent" as a parent group
        http -a Administrator:Administrator POST http://localhost:8080/nuxeo/api/v1/groups entity-type=group id=child parentGroups:='["parent"]'
        
      3. Verify the parent/child relation
        http -a Administrator:Administrator GET http://localhost:8080/nuxeo/api/v1/groups/child?fetch.group=parentGroups
        
        {
            "entity-type": "group", 
            "grouplabel": "child", 
            "groupname": "child", 
            "id": "child", 
            "parentGroups": [
                "parent"
            ], 
            "properties": {
                "description": null, 
                "grouplabel": null, 
                "groupname": "child", 
                "tenantId": null
            }
        }
        
      4. Update the "child" group to add the "Administrator" user a a member
        http -a Administrator:Administrator PUT http://localhost:8080/nuxeo/api/v1/groups/child entity-type=group id=child memberUsers:='["Administrator"]'
        
      5. Fetch the group with is member users and parent groups
        http -a Administrator:Administrator GET http://localhost:8080/nuxeo/api/v1/groups/child?fetch.group=memberUsers,parentGroups
        
        {
            "entity-type": "group", 
            "grouplabel": "child", 
            "groupname": "child", 
            "id": "child", 
            "memberUsers": [
                "Administrator"
            ], 
            "parentGroups": [], 
            "properties": {
                "description": null, 
                "grouplabel": null, 
                "groupname": "child", 
                "tenantId": null
            }
        }
        

        The parent groups have been reset.

      See recent changes made for NXP-22542, but the issue was probably already there.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 6 hours
                  6h