Hyperlink in Policy Violation

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hi,

We have requirement to show hyperlink in Rule Description under Policy Violation of Manage User Access Page. Is it possible to show hyperlink in same?

IIQ v8.3

We tried using a href, unicode characters but nothing is working yet.

Hi @ashishbhatia

Can you try with the following sentence in the text description?

<html>
    <a href="url">Text link </a>
</html>

Hi @ismaelmoreno1,

Thanks for the suggestion, but it is not working.

Hi Ashish,
As part of Vulnerability fix in 8.2.p3 Sailpoint changed defauld HTML rendering

IIQFW-1
[SECURITY] SailPoint Form sections with type `text` or `datatable` no longer render
HTML by default. Fields that need to display HTML must now provide the
`contentIsEscaped` attribute and set it to `true`. Any dynamic or user-entered
content in the field must be escaped in order to be secure.

Althought it is for forms I suspect similarly it may work for Policies

 <Attributes>
    <Map>
      <entry key="contentIsEscaped" value="true"/>
      <entry key="sysDescriptions">
        <value>
          <Map>
            <entry key="en_US" value="&#xA;              &lt;html>&#xA;    &lt;a href=&quot;url&quot;>Text link &lt;/a>&#xA;&lt;/html>&#xA;                  "/>
          </Map>
        </value>
      </entry>
    </Map>
  </Attributes>

Try something like that

The Ui is stripping most of the HTML code from the description (and almost all other elements as well).

I have create and tested a workaround for the Policy Violation Page. For the access request page a similar function can be created.

  • put the following text in the description: PLACEHOLDER
  • on the file-system create a new file in the scripts folder of the identityiq web application called: custom.js
  • place the following in this new file:
/*
* Custom Javascript functions may be placed here.
* */

if (window.location.href.indexOf("policyViolation") > -1) {
  var intervalId = setInterval(function () {
    var replaced = 0;
    $('.ng-binding.ng-scope').each(function () {
      // get element text
      var text = $(this).text();
      // check if replacement is needed
      if (text.indexOf('PLACEHOLDER') > -1) {
        // modify text
        text = text.replace('PLACEHOLDER', '<a href="http://www.google.com">Google</a>');
        // update element text
        $(this).html(text); // use html() instead of text() to render the anchor tag
        replaced = 1

      }
    });
    if (replaced == 1) {
      clearInterval(intervalId);
    }

  }, 1000); // 1000 milliseconds = 1 second
}

This Javascript replaces the string PLACEHOLDER with the link provided in the Javascript.

Policy Rule Config:
image

This gives:
image

I hope this will help you with your requirement.

– Remold

1 Like

Hi @kjakubiak,
Thanks for the suggestion, this works in Forms. I have tried with policy/rule description, but this is not working

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.