Questions tagged [runwithelevatedprivileges]

A method of the SPSecurity class, RunWithElevatedPrivileges executes the specified method with Full Control rights even if the user does not otherwise have Full Control.

A method of the SPSecurity class, RunWithElevatedPrivileges executes the specified method with Full Control rights even if the user does not otherwise have Full Control.

88 questions
2
votes
4 answers

Scenarios in which Run With Elevated Privilege is must

I just wanted to know in what are the Scenarios RWEP must be given for our code to work. Because, in situations like creating a site column my code works with and with-out RWEP option. So, In what are all the scenarios run with elevated privilege is…
Gokul
  • 37
  • 1
  • 6
1
vote
1 answer

DoesUserHavePermissions problems

This code create a Treeview (in a web part) of our sites and subsites and works perfectly for the admin account but not for a normal user, it list sites and subsites even if the user doesn't have access (he's not a member of any group) and it's not…
user24566
  • 35
  • 9
0
votes
1 answer

Creating new site object or OpenWeb does it automatically for RWEP

There is list present on SiteCol1\RootWeb. UserA does not have permission on SiteCol1. So we are using RWEP. We read that we need to create new objects for site and web. However, foll. code works, I need to know if using (SPWeb rootWeb =…
variable
  • 4,473
  • 13
  • 75
  • 139
-3
votes
2 answers

RunWithElevatedPrivileges throws error, that the page is not accessible

I am trying to validate the group at the time of login, have used runwithelevated but still I get an error on "SPGroup managerGroup = Web.Groups["DevTest"];" That the page is not accessible. How can I get beyond this. If I run the same code once I'm…
Muskan
  • 886
  • 9
  • 30