How to run SharePoint code with Elevated Privileges ?What are the security risks in it ?

SharePoint elevated privileges, site collection administrator code RunWithElevatedPrivileges is a class in SharePoint which comes under SPSecurity namespace. It allows developers to create the code that runs as the System Account instead of the logged in user, essentially giving that user Administrator Level Permissions in a specific space. So there is a question that, Run with elevated privileges can create high security risk ? Security risk is very minimal as the user will only have permission to do exactly what the developer will allow them through the code. Here is a syntax for that:

 private void yourFunction() 
 // Non-Elevated Permission Code Goes Here 
 { // Elevated Permission Code Goes Here }); // Non-Elevated Permission Code Goes Here }
Share on Google Plus

Please write your comment below. Share this blog on Social media.


Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks