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 RunWithElevatedPrivileges
RunWithElevatedPrivileges 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 method
SPWeb.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........
Difference between SPSite and SPWeb object
The SPSite object represents a collection of sites, i.e. Site Collection, a top level site and all its sub sites......
Post your comment