我在 Visual Studio 中创建了一个 SharePoint 工作流程,我已从默认的 SharePoint 审批工作流程扩展了此工作流程,如下所述 此处
工作流程运行正常。有没有办法让工作流程在用户而不是系统帐户的上下文中运行?
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)
这并不像看起来那么理想,有几个原因。首先,工作流程必须执行用户无权直接执行的操作。其次,工作流是后台任务,因此在代码运行时可能没有登录用户。
如果您只需要以用户身份运行特定任务,请查看 http://blackninjasoftware.com/2009/04/09/how-to-programmatically-impersonate-users-in-sharepoint/
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/