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

Can not remove an element of a relationship map by value

    XMLWordPrintable

    Details

      Description

      You can remove elements of a string array if you know the value of the element.  For example, if a managed user has the property:

       "groups":["employee","manager"]}
      

      you can execute a REST request with:

      '[{"operation":"remove","field":"/groups","value":"employee"}]' 
      

      and "groups" will be updated to "groups":["manager"]

      If you use this syntax to try to remove an element of a relationship map, no error is returned but the relationship element is not removed. For example, the request:

      $ curl -k -u openidm-admin:openidm-admin -d '[{"operation":"remove","field":"/authzRoles","value":{"_ref": "repo/internal/role/openidm-authorized"}}]' https://localhost:8443/openidm/managed/user/f3796bd2-1ec5-4220-bb69-8be34a83de4c -X PATCH -H 'Content-type:application/json'
      

      returns the managed object in response, but the relationship values remain the same:

      {"_id":"f3796bd2-1ec5-4220-bb69-8be34a83de4c","_rev":"7","mail":"nhunt@example.com","sn":"Hunt","givenName":"Nena","accountStatus":"active ","telephoneNumber":"1234567890","userName":"nhunt","effectiveRoles":[],"effectiveAssignments":[],"groups":["manager"]}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbranch Jon Branch
                Reporter:
                nena.hunt Nena Hunt [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: