<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hide error and div when user is not allowed to see object in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325590#M7445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an issue with my mashup and don't know how to handle it. Maybe someone can help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mashup contains objects from 2 different apps. User A is allowed to see all objects while user B should only see some objects from one app. When i open the mashup with user B, error 403 is popping up and displays "forbidden". Even so i can browse through the website with that user.&lt;/P&gt;&lt;P&gt;First of all I dont want that error to be displayed. How can I do that? &lt;/P&gt;&lt;P&gt;Futhermore is it possible to hide the empty divs with for user B? Otherwise the page looks realy awkward with only some of the objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jul 2017 14:16:14 GMT</pubDate>
    <dc:creator>valle</dc:creator>
    <dc:date>2017-07-04T14:16:14Z</dc:date>
    <item>
      <title>Hide error and div when user is not allowed to see object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325590#M7445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an issue with my mashup and don't know how to handle it. Maybe someone can help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mashup contains objects from 2 different apps. User A is allowed to see all objects while user B should only see some objects from one app. When i open the mashup with user B, error 403 is popping up and displays "forbidden". Even so i can browse through the website with that user.&lt;/P&gt;&lt;P&gt;First of all I dont want that error to be displayed. How can I do that? &lt;/P&gt;&lt;P&gt;Futhermore is it possible to hide the empty divs with for user B? Otherwise the page looks realy awkward with only some of the objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325590#M7445</guid>
      <dc:creator>valle</dc:creator>
      <dc:date>2017-07-04T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hide error and div when user is not allowed to see object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325591#M7446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You probably need to get the list of apps available to the user at startup. If the user has no access to an app, hide (or remove) the divs from the HTML page, otherwise open the app and get the objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 07:26:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325591#M7446</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2017-07-05T07:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hide error and div when user is not allowed to see object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325592#M7447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option (assuming that it's the openApp that causes the error) could be to surround the openApp call with a javascript try/catch block. If you end up in the catch, it's time to hide the divs. Never tried this though, so I'm not sure it actually works. Would be easy for you to try,though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 11:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325592#M7447</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2017-07-05T11:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hide error and div when user is not allowed to see object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325593#M7448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help, but unfortunately i am not very skilled with JS. Maybe you can provide me some code?&lt;/P&gt;&lt;P&gt;You're right, the error is caused by openApp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:59:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325593#M7448</guid>
      <dc:creator>valle</dc:creator>
      <dc:date>2017-07-05T12:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hide error and div when user is not allowed to see object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325594#M7449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Documentation for try/catch is here: &lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch" title="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch"&gt;try...catch - JavaScript | MDN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be something like this:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14992884302615035 jive_text_macro" jivemacro_uid="_14992884302615035" modifiedtitle="true"&gt;
&lt;P&gt;var app;&lt;/P&gt;
&lt;P&gt;try {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; app = qlik.openApp("XXXXXXX",config);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; // if we are here, the user has access, so go on and get the objects&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; app.getObject("QV01","zzzzzz");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; app.getObject("QV02","yyyyyyy");&lt;/P&gt;
&lt;P&gt;} catch (e){&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //log error, can be removed when we've verified that it works&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log("openApp error",e);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //hide elements&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $("#QV01").hide();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $("#QV02").hide();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still haven't tested, so I don't really know if it works.. Please let us know if it does, might be useful for others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 21:06:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Hide-error-and-div-when-user-is-not-allowed-to-see-object/m-p/1325594#M7449</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2017-07-05T21:06:31Z</dc:date>
    </item>
  </channel>
</rss>

