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.

learn more… | top users | synonyms

2
votes
1answer
559 views

SPWeb.GetUserToken(x) vs SPWeb.Users[x].UserToken

I'm working in code to elevate an account with the Read role to a specific account with the Contribute role in order to create a list item. I currently get the SPUserToken for the contribution ...
2
votes
1answer
277 views

RunWithElevatedPrivileges doesn't work in Webpart Constructor

With Sharepoint 2007 I am using RunWithElevatedPrivileges to write to the Event Log, but if I place the call inside the Webpart constructor, I get a "Request Failed" message. However, if I put this ...
1
vote
1answer
111 views

Unauthorized error when adding form to a form library

I have a webpart that extracts a form from an infopath template then it attempts to add this to a form library in SharePoint. I get an unauthorized error 401 when it attempts to add the file. It ...
0
votes
1answer
129 views

SPWeb permissions inside RunWithElevatedPrivileges

Please consider following scenario: public override void ItemUpdated(SPItemEventProperties properties) { SPSecurity.RunWithElevatedPrivileges(delegate() { SPWeb web1 = properties.Web; ...
0
votes
0answers
18 views

Getting Site Collection admin email address if ReadOnly enabled

I have a site collection which is in read only state. I need to get Site Collection administrator's email address. I've tried to use elevated privileges, but still get "Attempted to perform an ...