Difference between Security Context of Workflow Code in SharePoint 2007 and 2010

By Namwar Rizvi - Last updated: Wednesday, May 16, 2012 - Save & Share - Leave a Comment

In SharePoint 2010, any code which executes because of the changes made by the workflow process will run in context of the user who either started the workflow or responsible for changes which caused the code to be executed.

But …

In SharePoint 2007,  any code which executes because of the changes made by the workflow process will always run in context of SharePoint\System.

Due to the above difference, your SharePoint 2007 code will be able to perform anything on your Site as it will always have Full Permissions whereas in SharePoint 2010, it will depend on the user permission. If you are porting your code from 2007 to 2010 and will need full permission then you should consider using SPSecurity.RunWithElevatedPrivileges method. For details on it, click here

Share
Posted in Architecture, Code, Information, Security, SP2010, Tips, Tools, Troubleshooting, Workflow • Tags: , , , , , , , Top Of Page

Write a comment