Phil - Thursday, January 17, 2013 3:41 PM:
I've been using Innovator for quite some time now,...and somehow the need to know this never came up. But my question is fairly simple: When a method runs, and it executes code..what login/identity is it using to execute that code?
For example: If I am writing some workflow server methods, that are executed when a user votes. If this code is updating the Item after the user votes, what account is that method using to run the code?
My suspicion is the currently logged on user, but I'm not sure. If that is the case, is there a way within the method to specify what user account to run the code as? My users do not have permissions to do a lot of things, and I am encountering errors during workflow methods that run after a general user votes.
Thanks in advance.
zahar - Thursday, January 17, 2013 4:00 PM:
your suspicion are right. But you can user simple code to assign "Aras PLM" or other identity to user and revoke it after you finish:
Aras.Server.Security.Identity plmIdentity;
bool PermissionWasSet;
//asign ARAS PLM to current user
plmIdentity = Aras.Server.Security.Identity.GetByName("Super User");
PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);
try {
// your code here
} catch (Exception) {
}
//Revoke ARAS PLM from current user
if (PermissionWasSet) {
Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);
}
Phil - Friday, January 18, 2013 3:28 PM:
Zahar: Thank you very much for the code...it seems to be working well. Is that functionality documented anywhere, or did you just figure it out?
zahar - Friday, January 18, 2013 3:41 PM:
Phil,
I have copied this code from other aras methods. If you check other methods that came with aras modules you can find lots of ideas how to handle different issues that you have for your implementations.