<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ApplySQL Previleges Issue</title><link>https://www.aras.com/community/f/development/36274/applysql-previleges-issue</link><description>Hello All, 
 I have a method that uses ApplySQL which works just fine for the user that have administrative privileges. However, for non-admin users the method does not work and error out. Learned that this is because of the function ApplySQL, so trying</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: ApplySQL Previleges Issue</title><link>https://www.aras.com/community/thread/6271?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 10:37:51 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:7453d9f5-6b57-4179-af7c-5efe4e08c0d2</guid><dc:creator>miraks</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;If you need to use applySQL, you can do it on server side only like this:&lt;br /&gt; var superidentity = Aras.Server.Security.Identity.GetByName(&amp;quot;Administrators&amp;quot;);&lt;br /&gt; bool permissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(superidentity);&lt;br /&gt; &lt;br /&gt; var sql= &amp;quot;your sql order here&amp;quot;;&lt;br /&gt; var updateReturn = innovator.applySQL(sql);&lt;br /&gt; if (permissionWasSet) {&lt;br /&gt; Aras.Server.Security.Permissions.RevokeIdentity(superidentity); &lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;If you need to do it in javascript, you will have to call the server method from the javascript.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ApplySQL Previleges Issue</title><link>https://www.aras.com/community/thread/6270?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 08:15:51 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e772a3df-fe72-4889-a1c2-fda61db36498</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;I wonder if applySQL in a JS Method will work at all. It definitely makes sense that Innovator will restrict direct SQL inside a client Method.&lt;/p&gt;
&lt;p&gt;But there are also other factors that can restrict Method execution. Which Innovator version are you using? Innovator 12 or 11?&lt;/p&gt;
&lt;p&gt;In Innovator 12 Aras changed default Method &amp;quot;can execute&amp;quot; to &amp;quot;Administrators&amp;quot;.&amp;nbsp;You have to change this property to a appropriate user group (not &amp;quot;World&amp;quot; !!).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Instead of using loadAML, I would use a simpler structure for the query that basically does the same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;var inn = new Innovator();&lt;br /&gt;var doc = inn.newItem(&amp;quot;MyDoc&amp;quot;, &amp;quot;get&amp;quot;);&lt;br /&gt;doc.setAttribute(&amp;quot;select&amp;quot;, &amp;quot;id,&amp;quot;);&amp;nbsp;&lt;br /&gt;doc.setPropertyCondition(&amp;quot;xyz&amp;quot;,&amp;quot;like&amp;quot;);&lt;br /&gt;&lt;span&gt;doc&lt;/span&gt;&lt;span&gt;.setProperty(&amp;quot;&lt;/span&gt;&lt;span&gt;xyz&lt;/span&gt;&lt;span&gt;&amp;quot;,&amp;quot;%abc%&amp;quot;);&lt;/span&gt;&lt;br /&gt;doc = doc.apply();&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>