Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
Difference between runwithelevatedprivileges and allowunsafeupdates ?

Posted On: 13/11/2014 09:19:56
AllowUnsafeUpdates: If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.

RunWithElevatedPrivileges : There are certain object model calls model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when request is initiated by a nonprivileged user. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.
Posted On: 13/11/2014 09:21:03

Allow unsafe update tells to update the item no matter that it is belong to SPWeb. Whay do we need to tell it specifically, it is by design..We need to do it no matter to security it is just the way to update these type of data.

RunWithElevatedPrivileges  tells to run this part of code by using Application Pool account which is "high level system administrator" it allows to access any secured resources.

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us