How to get or create Supervisor UserConnection in C# script while authorized from another user?
Good day, colleagues.
IProcessExecutor processExecutor = _userConnection.ProcessEngine.ProcessExecutor; return processExecutor.Execute("VERY_IMPORTANT_PROCESS", valuesDictionary);
In context of my question, this simple script have multiple calling from different users (sessions) in one period of time. So i need to use Supervisor UserConnection to clarify "VERY_IMPORTANT_PROCESS" logging. Is it possible? Any workarounds?
Like
Hello,
Something similar was implemented in the RunSendEmailToCaseGroupV2 business process:
UserConnection userConnection = UserConnection; if (userConnection.CurrentUser.ConnectionType == UserType.SSP) { userConnection = userConnection.AppConnection.SystemUserConnection; } ...
Here the system checks if the current user is an external user and if so - replaces the userConnection with systemUserConnection (which is a Supervisor user).
You can try the same approach in your code to make sure the business process is called under the Supervisor user.
Hello,
Something similar was implemented in the RunSendEmailToCaseGroupV2 business process:
UserConnection userConnection = UserConnection; if (userConnection.CurrentUser.ConnectionType == UserType.SSP) { userConnection = userConnection.AppConnection.SystemUserConnection; } ...
Here the system checks if the current user is an external user and if so - replaces the userConnection with systemUserConnection (which is a Supervisor user).
You can try the same approach in your code to make sure the business process is called under the Supervisor user.
Alexey,
Yes, this should be so. If it's not sufficient, then the whole approach with the desired functionality should be changed.