SharePoint, Execution Context & Security
Nov 19
(I have originally published this article on the Orckestra’s Dot Net For Thougts Blog)
At least once in his career, a SharePoint developer is going to be faced with a security problem.
When a user executes an action in SharePoint, i.e. modifies an item in a list, the request on the server executes using the security context of the user. So, if the user does not have the right privileges to accomplish specific actions, the request could fail with a security exception.
A way to overcome this behaviour is to use the RunWithElevatedPrivileges method from the SPUtility class.