I have a GUI Extension calling the core service to publish a page. However, the publish user is always the impersonation user. I want the publish user to be the one using the GUI. I have the following code, but it only works when I add an impersonation user, and the actions are then performed by the impersonation user:
string binding = "netTcp_2011";
using (var client = new SessionAwareCoreServiceClient(binding))
{
client.Impersonate("robert");
//....
client.Publish(arrItems, instruction, target.ToArray(), GetPublishPriority(publishItem.Priority), readoptions);
}
Is there any way to execute the client.Publish command under the identity of the GUI user?