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

Updating relationship with the same object in a different relationship will not delete reverse references of the updated relationship.

    Details

    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      1
    • Sprint:
      2019.7 - IDM

      Description

      Setup:
      1) Add a property to the managed user schema called favoriteManager which has this setup.

                         "favoriteManager" : {
                              "type" : "relationship",
                              "validate" : true,
                              "description" : "",
                              "title" : "Best Friend",
                              "viewable" : true,
                              "searchable" : false,
                              "returnByDefault" : true,
                              "properties" : {
                                  "_ref" : {
                                      "type" : "string"
                                  },
                                  "_refProperties" : {
                                      "type" : "object",
                                      "properties" : {
                                          "_id" : {
                                              "type" : "string"
                                          }
                                      }
                                  }
                              },
                              "resourceCollection" : [
                                  {
                                      "path" : "managed/user",
                                      "label" : "User",
                                      "query" : {
                                          "queryFilter" : "true",
                                          "fields" : [
                                              "userName",
                                              "givenName",
                                              "sn"
                                          ]
                                      }
                                  }
                              ],
                              "userEditable" : false
                          },
      (code}
       # Create 3 users. empolyee1, employee2, boss.
       # make the manager of employee1 and employee2 to be boss.
       # make the favoriteManager of employee1 and employee2 to be boss.
      
      Request:
       # read the employee1 object with
      {code:java}
      managed/user/employee1?_fields=*

      . Note that both the manager and favoriteManager should return in the results.

      1. update the employee1's manager to be employee2:
        PUT openidm/managed/user/employee1 
        {
             [other user fields]...
             "manager": {"_ref","managed/user/employee2"} 
             "favoriteManager": {"_ref","managed/user/boss1"}
        }
        

      Verify:

      1. read the boss1 reports.
        managed/user/boss1?_fields=*,reports
      1. It should be expected that boss1 no longer has employee1 as a report.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jason.vincent jason vincent
                Reporter:
                jason.vincent jason vincent
                QA Assignee:
                Michal Orlik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: