As far as I understand, the workflows created in SharePoint designer that should launch under the credentials of the system account will no longer start automatically. So what should we do in cases when code is running under elevated privileges. Is there any way other than initiating workflows programmatically through code?
2 Answers
It's not a problem I've come across, but you could try impersonating another user, rather than elevating privileges:
// Using the User Token for the System Account is like running with elevated privileges.
SPUserToken userToken = ...
using (SPSite site = new SPSite(url, userToken ))
{
using (SPWeb web = site.OpenWeb())
{
//Do Stuff
}
}
We talking 2010?
If so, insert an impersonation step in the workflow and drop in your desired actions. Publish the workflow. The operations within that impersenation step will run in the context of who published the workflow, i.e. someone with full control access to the site.