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

unAssignment script undetected by defaultMapping.js

    Details

      Description

      When creating an assignment and setting an unAssignment script, the script is never invoked by OpenIDM during the unAssignment operation. This is due to line 142 of defaultMapping.js (../openidm/bin/defaults/roles/):

                          var onUnassignment = oldAssignment.onUnassignment;
      

      Which is expecting the script attribute to be 'onUnassignment' but it is actually called 'unAssignment':

      {
          "_id":"assignmentIdValue",
          "_rev":"1",
          "name":"assignmentName",
          "value":"assignmentValue",
          "description":"assignmentDescription",
          "mapping":"managedUser_systemLdapAccount",
          "assignmentOperation":"mergeWithTarget",
          "unassignmentOperation":"removeFromTarget",
          "attributes":[
          ],
          "onAssignment":{
              "type":"text/javascript",
              "globals":{
              },
              "file":"scripts/onAssignmentScript.js"
          },
          "unAssignment":{
              "type":"text/javascript",
              "globals":{
              },
          "file":"scripts/onUnassignmentScript.js"
          }
      ]
      

      This can be worked around by adjusting the line mentioned above (defaultMapping.js 142) to:

                          var onUnassignment = oldAssignment.unAssignment;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alin Alin Brici
                Reporter:
                tom.wood Tom Wood
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: