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


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> SharePoint >> Post New Question Subscribe to Interview Questions

What does RunWithElevatedPrivileges do?

Posted By :abhays     Posted Date :May 21, 2014    Points :40   Category :SharePoint 
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.

It's executes the specified method with Full Control rights even if the user does not otherwise have Full Control.

A delegate method that is to run with elevated rights. This method runs under the Application Pool identity, which has site collection administrator privileges on all site collections hosted by that application pool.

Syntax

SPSecurity.RunWithElevatedPrivileges(delegate()
{
// implementation details omitted
});




You can also find related Interview Question to What does RunWithElevatedPrivileges do?  below: 

What does RunWithElevatedPrivileges do?

  
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.
(More...)

What is the performance impact of RunWithElevatedPrivileges?

  
Ans. RunWithElevatedPrivileges creates a new thread with the App Pool's credentials, blocking your current thread until it finishes. (More...)

What does RunWithElevatedPrivileges do?

  

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.
. What does SPWeb.EnsureUser method do?
Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site.
e.g SPUser usr = myWeb.EnsureUser("hitenders") (More...)

What is performance impact of RunWithElevatedPrivileges?

  
Performance impacts with RunWithElevatedPrivileges create new Thread with app pool's credential ,blocking your current thread until it finishes. (More...)

What is the performance impact of RunWithElevatedPrivileges?

  
Performance impact with RunWithElevatedPrivileges creates a new thread with the App Pool's credentials, blocking your current thread until it finishes. (More...)

Does it matter if I use RunWithElevatedPrivileges in SPJobDefinition?

  
Yes,Jobs are executed under SharePoint timer service account. This account could have not full control permissions. It's permissions could be restricted. (More...)

What is the performance impact of RunWithElevatedPrivileges?

  
RunWithElevatedPrivileges creates a new thread with the App Pool's credentials, blocking your current thread until it finishes. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


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