1
votes

I have created a SharePoint workflow in visual studio , I have extended this workflow from the default SharePoint approval workflow as discribed here

The workflow is running properly. Is there a way I can get the workflow to run in the context of the user instead of th system account?

1
Edit: What I am really trying to do is duplicate the OOTB approval workflow and have the modifier be the person who actually changed the item instead of system account - Adonis L

1 Answers

1
votes

There are a couple of reasons this is not as desirable as it might seem. Firstly, the wrorkflow has to do things that the user does not have permissions to do directly. Secondly, workflows are background tasks, and as such there may not be a logged in user when the code is running.

If you just need a specific task to run as a user, take a look at http://blackninjasoftware.com/2009/04/09/how-to-programmatically-impersonate-users-in-sharepoint/