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

Duplicate relationships created with conditional logic

    XMLWordPrintable

    Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not a defect
    • 7.2.0, 7.1.0
    • None
    • None

      Description

      When using the "condition" feature of conditional roles, if there is an existing relationship between a user for which the condition applies and the role, there will be a duplicate relationship created between them. For example, consider these steps to reproduce:

      1. curl -u openidm-admin:openidm-admin http://localhost:8080/openidm/managed/user/jfeasel -X PUT -H 'Content-type: application/json' --data '{"userName": "jake.feasel","givenName":"Jake","sn":"Feasel","mail":"jfeasel@example.com"}'
      2. curl -u openidm-admin:openidm-admin http://localhost:8080/openidm/managed/role/feasels -X PUT -H 'Content-type: application/json' --data '{"name": "Feasels"}'
      3. curl -u openidm-admin:openidm-admin http://localhost:8080/openidm/managed/user/jfeasel/roles?_action=create -X POST -H 'Content-type: application/json' --data '{"_ref": "managed/role/feasels"}'
      4. curl -u openidm-admin:openidm-admin http://localhost:8080/openidm/managed/role/feasels -X PATCH -H 'Content-type: application/json' --data '[
        {"operation": "add", "field": "condition", "value": "sn eq \"Feasel\""}

        ]'

      5. curl -u openidm-admin:openidm-admin http://localhost:8080/openidm/managed/role/feasels/members?_queryFilter=true

       

      Expected result:

      There should be one record - the relationship that was explicitly created at step 3.

      Actual result:

      Two records - the relationship from step 3 and a new one that was created from the condition at step 4.

       

        Attachments

          Issue Links

            Activity

              People

              dhogan Dirk Hogan
              jake.feasel Jake Feasel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: