Role of AllowUnsafeUpdates
Explain the role of AllowUnsafeUpdates.- AllowUnsafeUpdates allows updates on a GET request. - It basically allows code to bypass security validation while making changes to Sharepoint objects which are not executed within a HTTP POST request. - It will get or set a Boolean value that will specify whether to allow updates to the database as a result of a GET request or without requiring a security validation. - We need to set SPWeb.AllowUnsafeUpdates = true whenever the code modifies the SharePoint data in some way or whenever an update is needed on the SharePoint objects like SPWeb, SPList, SPListItem etc without requiring a security validation.
|
Role of RunWithElevatedPrivilegesRunWithElevatedPrivileges executes code as the System account. This basically
then means that the code that you supply as a delegate to the method......
Role of SPWeb.EnsureUser methodSPWeb.EnsureUser method validates whether the specified login name belongs to a
valid user of the website or not. If the login name does not exist then it adds
the login name to the website........