<?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 Get current local security in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264939#M99560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know there is only macro function for that.&lt;/P&gt;&lt;P&gt;I have used following setup (in desktop mode, maybe works in IE also):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- create variable vModuleSecurityMode&lt;/P&gt;&lt;P&gt;- create warning message text box with show condition vModuleSecurityMode&amp;lt;2&lt;/P&gt;&lt;P&gt;- add following actions to Document Properties OnOpen trigger:&lt;/P&gt;&lt;P&gt; 1) set variable vModuleSecurityMode to 0&lt;/P&gt;&lt;P&gt; 2) run macro "securitycheck"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub securitycheck&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("vModuleSecurityMode")&lt;/P&gt;&lt;P&gt;' OnOpen trigger sets this variable to 0&lt;/P&gt;&lt;P&gt;' then runs this macro to check security level and change the variable&lt;/P&gt;&lt;P&gt;' if System Access is allowed then 2, if safe mode then 1&lt;/P&gt;&lt;P&gt;' Blocked mode blocks the macro and variable stay 0&lt;/P&gt;&lt;P&gt;' Front page has warning message displayed when vModuleSecurityMode &amp;lt; 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ms = ActiveDocument.GetCurrentModuleSecurity '2=System Access, 1=SafeMode&lt;/P&gt;&lt;P&gt;v.SetContent ms,false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the warning message will show up when macros are blocked or limited to safe mode. &lt;/P&gt;&lt;P&gt;It's useful to hint the Ctrl+Shift+M in the same message so user can fix it immediately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2011 22:02:24 GMT</pubDate>
    <dc:creator>tanelry</dc:creator>
    <dc:date>2011-08-11T22:02:24Z</dc:date>
    <item>
      <title>Get current local security</title>
      <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264938#M99559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro which needs System Access&lt;/P&gt;&lt;P&gt;As it would be difficult to force enduser's local security, I would prefer to place a warning if his Current Local Security is set to "Don't Run at All" or "Only Safe Mode". How do I do that? Is there a system function that I can use? Or do I need to write a new macro for checking this setting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 06:40:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264938#M99559</guid>
      <dc:creator />
      <dc:date>2011-08-11T06:40:50Z</dc:date>
    </item>
    <item>
      <title>Get current local security</title>
      <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264939#M99560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know there is only macro function for that.&lt;/P&gt;&lt;P&gt;I have used following setup (in desktop mode, maybe works in IE also):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- create variable vModuleSecurityMode&lt;/P&gt;&lt;P&gt;- create warning message text box with show condition vModuleSecurityMode&amp;lt;2&lt;/P&gt;&lt;P&gt;- add following actions to Document Properties OnOpen trigger:&lt;/P&gt;&lt;P&gt; 1) set variable vModuleSecurityMode to 0&lt;/P&gt;&lt;P&gt; 2) run macro "securitycheck"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub securitycheck&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("vModuleSecurityMode")&lt;/P&gt;&lt;P&gt;' OnOpen trigger sets this variable to 0&lt;/P&gt;&lt;P&gt;' then runs this macro to check security level and change the variable&lt;/P&gt;&lt;P&gt;' if System Access is allowed then 2, if safe mode then 1&lt;/P&gt;&lt;P&gt;' Blocked mode blocks the macro and variable stay 0&lt;/P&gt;&lt;P&gt;' Front page has warning message displayed when vModuleSecurityMode &amp;lt; 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ms = ActiveDocument.GetCurrentModuleSecurity '2=System Access, 1=SafeMode&lt;/P&gt;&lt;P&gt;v.SetContent ms,false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the warning message will show up when macros are blocked or limited to safe mode. &lt;/P&gt;&lt;P&gt;It's useful to hint the Ctrl+Shift+M in the same message so user can fix it immediately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 22:02:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264939#M99560</guid>
      <dc:creator>tanelry</dc:creator>
      <dc:date>2011-08-11T22:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get current local security</title>
      <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264940#M99561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tanel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very helpful answer. However, I still have one behavior that I can't manage. Here is my current implementation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the opening of the document:&lt;/P&gt;&lt;P&gt; - vModuleSecurityMode is set to 0&lt;/P&gt;&lt;P&gt; - macro securitycheck is executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that macro won't get executed for user who has the security level = 0 (Stop all module Script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I made an alternative to your answer, I am not using a textbox for showing the message, but an alert (with the same condition as you mentioned, and with following settings:&lt;/P&gt;&lt;P&gt; - Show a pop-up / Mode = Interactive&lt;/P&gt;&lt;P&gt; - Events: On Open&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advantage: Even people with security level = 0 will get the pop-up at the opening of the document&lt;/P&gt;&lt;P&gt;Problem: Alert will run before the macro (that I set at the opening of the document) so vModuleSecurityMode is still set to 0 before the alert is fired. and even people who has security level = 1 or 2, will get the pop-up ;(. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to find alternative, but so far, nothing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 06:08:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264940#M99561</guid>
      <dc:creator />
      <dc:date>2011-08-15T06:08:04Z</dc:date>
    </item>
    <item>
      <title>Get current local security</title>
      <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264941#M99562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see a good way to make it work with alerts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But a big red warning in a text box is almost as good. It also shows up when macros are blocked. You can even hide critical worksheets while vModuleSecurityMode &amp;lt; 2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 11:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264941#M99562</guid>
      <dc:creator>tanelry</dc:creator>
      <dc:date>2011-08-15T11:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get current local security</title>
      <link>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264942#M99563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a special Worksheet with the Information "Security Level to low" and the Ctrl+Shift+M Information.&lt;/P&gt;&lt;P&gt;Insert a Button "Recheck Module Security" to fire a macro to recheck Module Security.&lt;/P&gt;&lt;P&gt;Show this worksheet only, when Variable = 0 or 1.&lt;/P&gt;&lt;P&gt;All other Sheets should be visible only when Variable = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Start fire a macro to find out, which ModuleSecurity is available (ActiveDocument.GetCurrentModuleSecurity).&lt;/P&gt;&lt;P&gt;Set the Variable to 1 or 2. If Security Level is to low to fire the macro, the Variable is still 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 15:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-current-local-security/m-p/264942#M99563</guid>
      <dc:creator />
      <dc:date>2012-01-18T15:33:17Z</dc:date>
    </item>
  </channel>
</rss>

