.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani

Home >> Forum >> SharePoint >> Post New QuestionBookmark and Share Subscribe to Forum

what permission level RunWithElevatedPrivileges in SharePoint

Posted By: William Thompson     Posted Date: April 18, 2010    Points:2   Category :SharePoint
Under what permission level will RunWithElevatedPrivileges work
what is the use of using in
SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
using (SPSite ElevatedsiteColl = new SPSite(siteColl.ID))
using (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(site.ID))
string SiteCollectionOwner = ElevatedsiteColl.Owner.Name;
string Visits = ElevatedsiteColl.Usage.Visits.ToString();
string RootAuditEntries =

Author: William Thompson             
Posted Date: April 18, 2010     Points: 5   

I got the solution..

Whenever we use RunWithElevatedPrivileges the process which actually running the code will create new thread and that thread will running under the SharePoint webapplication's application pool identity - which is normally the "system account"

Author: Sunil Yadav       [Moderator]      
Posted Date: May 24, 2010     Points: 5   


RunWithElevatedPrivileges runs with higher priveledges than the current user executing the code.
Lets say for example u have created a webpart which displays all the users form User Information List, in this case u need high privileged user to get list item from User Information List.This is where u need to user RunWithElevatedPrivileges.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend