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

Oracle repo: Adding users into managed user's reports field does not work properly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 7.0.0
    • Labels:
    • Environment:
      OpenIDM: 7.0.0-SNAPSHOT ff5d889
      oracle/database-enterprise:12.2.0.1
    • Target Version/s:

      Description

      Not able to add user relationship between users in field report, when IDM using Oracle repo. For others repo works correctly.

      1. Setup IDM with Oracle repo.

      2.1 Create user boss:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"id": "ricksutter", "userName": "boss", "givenName": "rick", "sn": "sutter", "mail": "rick@example.com", "telephoneNumber": "6669876987", "password": "Th3Password", "description": "Just another user"}' --request PUT "http://localhost:8080/openidm/managed/user/boss"
      

      2.2 Create user developer:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"id": "ricksutter", "userName": "developer", "givenName": "rick", "sn": "sutter", "mail": "rick@example.com", "telephoneNumber": "6669876987", "password": "Th3Password", "description": "Just another user"}' --request PUT "http://localhost:8080/openidm/managed/user/developer"
      

      2.3 Create user another_developer:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"id": "ricksutter", "userName": "another_developer", "givenName": "rick", "sn": "sutter", "mail": "rick@example.com", "telephoneNumber": "6669876987", "password": "Th3Password", "description": "Just another user"}' --request PUT "http://localhost:8080/openidm/managed/user/another_developer"
      

      3.1 Adding developer to boss:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '[{"operation":"add","field":"/reports/-","value":{"_ref":"managed/user/developer"}}]' --request PATCH "http://localhost:8080/openidm/managed/user/boss"
      

      3.2 Adding another_developer to boss:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '[{"operation":"add","field":"/reports/-","value":{"_ref":"managed/user/another_developer"}}]' --request PATCH "http://localhost:8080/openidm/managed/user/boss"
      

      4. GET to boss with field "reports":

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "http://localhost:8080/openidm/managed/user/boss?_fields=reports"
      

      Current result:

      { "_id": "boss",
        "_rev": "2",
        "reports": [
          {
            "_ref": "managed/user/developer",
            "_refResourceCollection": "managed/user",
            "_refResourceId": "developer",
            "_refProperties": {
              "_id": "9d8e028e-325c-41fd-951e-99f7ffd9a17c",
              "_rev": "0"
            }}]}
      

      Expected result:

      {
        "_id": "boss",
        "_rev": "2",
        "reports": [
          {
            "_ref": "managed/user/another_developer",
            "_refResourceCollection": "managed/user",
            "_refResourceId": "another_developer",
            "_refProperties": {
              "_id": "e118e3a3-c894-4cc7-bd23-e5143b2e9421",
              "_rev": "0"
            }},
          {
            "_ref": "managed/user/developer",
            "_refResourceCollection": "managed/user",
            "_refResourceId": "developer",
            "_refProperties": {
              "_id": "765c3f9f-a130-4abb-a237-01ef42941fb7",
              "_rev": "0"
            }}]}
      

      PyForge:

      [OpenIDM]
      version = 7.0.0-SNAPSHOT
      repo_type = oracle

      ./run-pybot.py -t create_manager_relationship_with_patch_on_manager -n openidm

        Attachments

          Activity

            People

            • Assignee:
              brmiller Brendan Miller
              Reporter:
              petr.bednar Petr Bednar [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: