In this post, I will explain
in which scenario we need to use SPSecurity.Runwithelevatedprivileges method in
sharepoint customisation.
There are many times when we need our code to perform certain functions that current logged In user does not have permission to perform. The SPSecurity class contains Runwithelevatedprivileges method that allow to run code under full control prilvileges.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
// Code
});
This delegate method run with elevated rights under the Application Pool identity which has site collection administrator privileges on all site collections.
There are many times when we need our code to perform certain functions that current logged In user does not have permission to perform. The SPSecurity class contains Runwithelevatedprivileges method that allow to run code under full control prilvileges.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
// Code
});
This delegate method run with elevated rights under the Application Pool identity which has site collection administrator privileges on all site collections.
No comments:
Post a Comment