Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-5409

Patching a user with option _fields=*,*_ref does not return relationship properties in response anymore

    XMLWordPrintable

Details

    • 0.5
    • OpenIDM Sprint 57

    Description

      Since commit 170b4621fdb done for OPENIDM-5337 by alin, patching a user with option _fields=,_ref does not return relationship properties in response anymore.

      Steps to reproduce
      1) launch plain vanilla OpenIDM

      2) create a managed user

      curl --header "If-None-Match: *" --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"userName": "rsutter", "telephoneNumber": "6669876987", "givenName": "rick", "description": "Just another John Doe or Joe Smith", "sn": "sutter", "mail": "rick@example.com", "password": "Th3Password"}' --request PUT "http://localhost:8080/openidm/managed/user/ricksutter"
      {"_id":"ricksutter","_rev":"91","userName":"rsutter","telephoneNumber":"6669876987","givenName":"rick","description":"Just another John Doe or Joe Smith","sn":"sutter","mail":"rick@example.com","accountStatus":"active","effectiveRoles":[],"effectiveAssignments":[]}

      3) patch this user using the option fields=,_ref to retrieve all the relationship properties in the response:

      Here is what we got before:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"replace","field":"mail","value":"change@patch.com"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter?_fields=*,*_ref"
      {
        "_id": "ricksutter",
        "_rev": "1",
        "userName": "rsutter",
        "telephoneNumber": "6669876987",
        "givenName": "rick",
        "description": "Just another John Doe or Joe Smith",
        "sn": "sutter",
        "accountStatus": "active",
        "effectiveRoles": [],
        "effectiveAssignments": [],
        "mail": "change@patch.com",
        "roles": [],
        "authzRoles": [
          {
            "_ref": "repo/internal/role/openidm-authorized",
            "_refProperties": {
              "_id": "b7066478-9489-42a7-99b6-fe186bd41a85",
              "_rev": "0"
            }
          }
        ],
        "reports": [],
        "manager": null
      }
      

      => we do get roles, authzRoles, reports, and manager => OK

      Here is what we get now:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"replace","field":"mail","value":"change@patch.com"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter?_fields=*,*_ref"
      {
        "_id": "ricksutter",
        "_rev": "92",
        "userName": "rsutter",
        "telephoneNumber": "6669876987",
        "givenName": "rick",
        "description": "Just another John Doe or Joe Smith",
        "sn": "sutter",
        "mail": "change@patch.com",
        "accountStatus": "active",
        "effectiveRoles": [],
        "effectiveAssignments": []
      }
      

      => we don't get roles, authzRoles, reports, and manager => NOT OK

      Attachments

        Issue Links

          Activity

            People

              alin Alin Brici
              laurent.bristiel Laurent Bristiel [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: