<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged read-only</title>
<link>https://overflow.efficy.io/?qa=tag/read-only</link>
<description>Powered by Question2Answer</description>
<item>
<title>Why can't I bypass the read-only dataset with Efficy.disableSecurity</title>
<link>https://overflow.efficy.io/?qa=6911/cant-bypass-read-only-dataset-with-efficy-disablesecurity</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I want to bypass a security (a customer who haven't the rigth to modify an entity) so I wrote this code : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SetContactRobinson: function(kCont, blacklisted) {
        if (!kCont) return;
        var editContext = Efficy.openEditContext(ntCont, kCont);

        //on désactive les sécurités pour permettre la modifications des contacts
        var disableSecurityOld = Efficy.disableSecurity;
        Efficy.disableSecurity = true;

        try {
            Efficy.updateField(editContext, 0, 'ROBINSON', (blacklisted ? &quot;1&quot; : &quot;0&quot;));
            Efficy.commitChanges(editContext, false);
        }
        finally {
            Efficy.closeContext(editContext);
            Efficy.disableSecurity = disableSecurityOld;
        }
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But I have this error : &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;!! ERROR: DS&lt;em&gt;ContEdit&lt;/em&gt;0_Cont: Cannot modify a read-only dataset&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I guess the data set is read only cause my user haven't right to modify this contact, but why &lt;code&gt;Efficy.disableSecurity = true;&lt;/code&gt; dosen't work here ? &lt;/p&gt;

&lt;p&gt;thanks in advance&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6911/cant-bypass-read-only-dataset-with-efficy-disablesecurity</guid>
<pubDate>Thu, 01 Jun 2023 08:49:33 +0000</pubDate>
</item>
</channel>
</rss>