What is Impersonation?Impersonation is the security feature that enables control of the Identity under which code is executed. Impersonation gives the following advantages:
What are the Impersonation methods in SharePoint 2010?SharePoint 2010 provides the following methods of Impersonation:
Note: System Account (SHAREPOINT\system) is the application pool user of SharePoint. If you are using Developer Installations on client operating systems (Windows 7 / Vista) the account name will be different.Now let us see how to use the above methods.
Note: In the case of RunWithElevatedPrivileges the System Account is used to perform the activity.
Running the CodeThe attached source contains the following samples:
We can see that the new item is created with the System Account as shown below: Referenceshttp://msdn.microsoft.com/en-us/library/aa543158.aspxSummaryIn this article we have explored 2 methods of Impersonation in SharePoint 2010. The associated code contains the example we have discussed.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: