This snippet elevates the privledge of the user to perform some action from the SharePoint Object model. Only the items declared in the elevated code is condiered elevated, all other objects are not.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite curSite = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = curSite.OpenWeb(SPContext.Current.Web.ID))
{
// Do stuff here
}
}
});