When creating a new Linq to SharePoint context, normally we don't pass a site object but we provide a request url.
So what should I do if I want to execute Linq queries under a different user context? Is there a way to do it?
Thanks in advance.
|
|
Ok, I found the answer to my own question. It is possible with switching HttpContext objects. Here are the steps:
This way the new context is created within the context of the prefererred user. I can provide code if someone needs it. |
|||||||
|
|
You can do as below :
You can also use SPSecurity.RunWithElevatedPrivileges block for the same. For in-depth information on the impersonation techniques, Check this out : |
|||
|
|