This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dynamic Bound List Boxes using XML file

I'm trying to implement a Bound List Box following the guidance at the following link - https://support.oneidentity.com/active-roles/kb/139754/how-to-create-a-bound-list-box-with-4-levels  Hard-coding the possibilities in the script works but I would like to use an XML file as the source for the Level Possibilities.  The issue is that the values change periodically and we would rather update a source XML rather than periodically edit the script itself.  Has anyone modified the script provided in the KB to use an XML rather than hard-coding the values?     

Parents
  • I re-implemented the SDK sample by populating from an XML file.

    Here is the sample XML file:

    <?xml version="1.0"?>

    <Departments>

                   <Department name="Development">

                                  <title>SD Engineer</title>

                                  <title>SD Manager</title>

                   </Department>

                   <Department name="Quality Control">

                                  <title>QC Engineer</title>

                                  <title>QC Manager</title>

                   </Department>

                   <Department name="Sales">

                                  <title>Salesperson</title>

                                  <title>Sales Manager</title>

                   </Department>

                   <Department name="Customer Service">

                                  <title>CS Representative</title>

                                  <title>CSR Manager</title>

                   </Department>

    </Departments>

    Save this to the following location on the Active Roles host: C:\Scripts\orgChart.xml

    Here is a working Policy Script:

    function onGetEffectivePolicy($Request)

    {

        if($Request.Class -eq "user")

        {

            $ScriptDir = 'C:\Scripts\orgChart.xml'

            [xml]$XML_Variable = Get-Content -Path $ScriptDir

            $departmentsArray = @()

            $possibleValues = @()

            $xmlDepartments = $XML_Variable.Departments.Department

            $departments = $xmlDepartments.name

            $Request.SetEffectivePolicyInfo('title', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'department')

            $Request.SetEffectivePolicyInfo('department', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, $departments)

            $department = GetCurrentValue -Request $Request -AttributeName 'department'

            ($xmlDepartments | Where-Object{$_.name -eq $department}).title | forEach-Object{ $possibleValues += $_.toString()}

            $Request.SetEffectivePolicyInfo('title', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, $possibleValues)                

        }

    }

     

    function GetCurrentValue($Request, [string]$AttributeName)

    {  

        trap {continue}

        $value = $Request.Get($AttributeName)

        if($value -eq $null)

            {

            $DirObj.GetInfoEx(@($AttributeName),0) | Out-Null

            $value = $DirObj.Get($AttributeName)

            }

        $value

    }

    NOTE: All of these Bound List Box samples only work in the Active Roles Web Interface. This functionality is not possible in the Active Roles Console.

  • NOTE: All of these Bound List Box samples only work in the Active Roles Web Interface. This functionality is not possible in the Active Roles Console.

    Why do ARS MMC  Client and WI Client behave different for end user? Is it to be treated as a bug? (I used to have issues with the Bound List Boxes SDK sample at AR 7.0.x couple years ago, though do not remember was it MMC or WI)

  • This client discrepancy is tied into this line:

    $Request.SetEffectivePolicyInfo('title', $Constants.EDS_EPI_UI_RELOAD_EPI_BY_RULE, 'department')

    The Active Roles SDK notes the following:

    <quote>

    The EDS_EPI_UI_RELOAD_EPI_BY_RULE policy causes the Web Interface to retrieve and reapply the EDS_EPI_UI_POSSIBLE_VALUES and EDS_EPI_UI_GENERATED_VALUE policies only.

    </quote> 

    So, this option is only expected to be available in the Active Roles Web Interface.

    From my testing, this is correct. The Active Roles Console does not query dropdown box changes.

  • thank you! I don't think it is an issue and in real world scenarios WI is the tool for HelpDesk to use.

Reply Children
No Data