Hrishikesh - Wednesday, May 15, 2013 11:59 AM:
Hi All,
I know how to set the Temporary Permission while Executing SQL Querys in Aras (C#).
below is the peace of Code where i Temporary assign the Permission to Administrators and after
executing the SQL Query, I revoke the Permission.
Aras.Server.Security.Identity qpIdentity = Aras.Server.Security.Identity.GetByName("Administrators");
bool PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(qpIdentity);
Brian - Wednesday, May 15, 2013 7:18 PM:
Hi Hrishikesh,
Can't do it directly in Javascript.
You will need to define a generic server method (see programmers guide) that can execute the actual query under the right permissions.
Let's say you define a server method called "ExecuteMySql".
In BLOCKED SCRIPT
var inn = this.innovator();
var body = "<sqlString>Select * from Part</sqlString>"
var result = inn.applyMethod("ExecuteMySql",body);
// now do something with the result.
In your server method:
Innovator inn = this.getInnovator();
string sqlString = this.getProperty("sqlString","");
// execute your code as before to run the query.
Item result = inn.applySQL(sqlString);
return result;
Hope this helps,
Brian.