- as indicates, you need to get the group membership values from user 1 into a node-set variable and then add those values to user 2.
Where you are in your driver channel/policy set/policy/rules will also impact exactly how you approach this desire. Updating this information in a connected application vs within the Vault will also impact the selection of steps required to get your desired results.
Assuming that you are working in a loopback driver subscriber channel, for an add event of a new user (user 2) the following sample code could be helpful. There should be additional error checking, and possibly checking for duplicates of Group Membership values if there is something in the DOM document being processed. If this were a Modify event, the example would need to be adapted for that operation instead of an add. The example uses a hard coded reference to query the source user in this example.
Query the source attribute Group Membership on the source user (user 1) to get the current values of that attribute and store them in a node-set local variable (lv-SrcGroupMembers)
Now check to see if the current operation (for user 2) has the operation attribute of Group Membership in the DOM document and if it is not, add it using the append XML and set XML attribute actions.
Finally add the Group Membership node-set of values from local variable nodset to the operational attribute in the DOM document for the target user (user 2) using the clone by XPath expression.
- as indicates, you need to get the group membership values from user 1 into a node-set variable and then add those values to user 2.
Where you are in your driver channel/policy set/policy/rules will also impact exactly how you approach this desire. Updating this information in a connected application vs within the Vault will also impact the selection of steps required to get your desired results.
Assuming that you are working in a loopback driver subscriber channel, for an add event of a new user (user 2) the following sample code could be helpful. There should be additional error checking, and possibly checking for duplicates of Group Membership values if there is something in the DOM document being processed. If this were a Modify event, the example would need to be adapted for that operation instead of an add. The example uses a hard coded reference to query the source user in this example.
Query the source attribute Group Membership on the source user (user 1) to get the current values of that attribute and store them in a node-set local variable (lv-SrcGroupMembers)
Now check to see if the current operation (for user 2) has the operation attribute of Group Membership in the DOM document and if it is not, add it using the append XML and set XML attribute actions.
Finally add the Group Membership node-set of values from local variable nodset to the operational attribute in the DOM document for the target user (user 2) using the clone by XPath expression.