If the code is required to be run under a context which does not belong to any windows user (AD user), and needs more privileges than the current user, we can use RunWithElevatedPrivileges and assign a delegate to it as shown below
SPSecurity.RunWithElevatedPrivileges(delegate() { //Put your code to be executed using elevated privileges });
No comments:
Post a Comment