The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
52 views

Getting the logged in user given the SPWeb, regardless of elevated priveleges

I have a requirement to be able to always get the logged in user. The object the calling process is going to pass is the spweb. As this is legacy code, I cannot change what the calling processes ...
0
votes
1answer
165 views

Enterprise wiki site collection Users privileges in sharepoint 2013

I have created a collaboration site collection which contain an enterprise wiki, and now my register users are being able to add, edit, delete and read wikis in a very reliable and efficient way. But ...
2
votes
1answer
90 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 ...
0
votes
1answer
50 views

Conditional SPSecurity.RunWithElevatedPrivileges

Is there a way to use SPSecurity.RunWithElevatedPrivileges conditionally. For example, assume that i have a code block, if some condition is met i want to run this code block in ...
0
votes
3answers
142 views

Unauthorized on XDocument.Load on Sharepoint

I'm trying to open an XML file from my document library. I'm running some code as "Elevated Privilege" on a file I know exists. The code I wrote down is this: ...
4
votes
2answers
198 views

SPQuery returning different before and after using RunWithElevatedPrivileges method

I am having a huge problem here. I am executing a query looking for a SPListItem, when I execute this query with user identity it works well, retuning the fields "Author" and "Editor" that I need. ...
1
vote
1answer
55 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
0answers
50 views

SocialTagManager - adding a tag as the app pool account

I've noticed the following behaviour when calling SocialTagManager.Add: Regular call: tag created with myself as owner Call in RunWithElevatedPrivileges: ditto Call in SPStatefulLongOperation: ditto ...
0
votes
2answers
215 views

SPD Workflow doesn't start automatically when creating or updating item under elevated privileges

As far as I understand, the workflows created in SharePoint designer that should launch under the credentials of the system account will no longer start automatically. So what should we do in cases ...
0
votes
1answer
103 views

I loss the listitem which was added to list using Item Added Event Receiver

I am using this code to break the permission.But i loss the listitem after refresh the page.Plz help me.. public override void ItemAdded(SPItemEventProperties properties) { ...
1
vote
3answers
734 views

SharePoint 2010 RunWithElevatedPrivileges() Throws Exception

I am trying to update a list item using: SPSecurity.RunWithElevatedPrivileges(delegate() { ... item.update();**// this line works** list.update();**//// exception thrown on this ...
0
votes
2answers
360 views

Event Receiver which tries to create a Prefix will throw Security Exception

I'm trying to use an Event Receiver on a List to create a Managed Path with Wildcard-inclusion in the parent WebApplication. I tried to handle it with the following code (reduced to show the idea) ...
1
vote
4answers
806 views

Returning a SPListItem in conjunction with RunWithElevatedPrivileges

* *Clarification. Application == Site Definition. Direct Database access is out the window ** I've created an application for SharePoint that utilizes some new approaches to coding List Access. I've ...
1
vote
1answer
283 views

Get list items even if user does not have access to those items

Is there a way to get items from a list even if the current user does not actually have acces to them? SPSecurity.RunWithElevatedPrivileges does not seem to work! I have a special case in which I ...
2
votes
1answer
182 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 ...
5
votes
5answers
780 views

How to detect if my code is running inside SPSecurity.RunWithElevatedPrivileges

Is there a way to detect if my code is running inside SPSecurity.RunWithElevatedPrivileges? class Foo { public static void Bar() { if (CODE_RUNS_ELEVATED) { Debug.WriteLine("You ...
0
votes
1answer
530 views

Unauthorized problem with impersonating an user

I'm trying to get this result: i want me to impersonate an user X, write down a file in a List (in which X has contribute rights), and change the privileges so that noone else can modify that.. So i ...
0
votes
1answer
834 views

Event Reciever run with elevated previledges

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part. I have included the SPSecurity.RunWithElevatedPrivileges but the same thing. ...
9
votes
3answers
1k views

Best way to Impersonate in SharePoint

So far, I am aware of below 3 ways of performing impersonation in a SharePoint web part or page : Using Win32 API [DllImport("advapi32.dll", SetLastError=true)] public static extern bool ...
4
votes
3answers
3k views

How to run with elevated privileges in application page?

I want to get a list item that the current user does not have access to but I need to get it in code. When I use SPSecurity.RunWithElevatedPrivileges that does not work. It's because I'm using the ...
0
votes
1answer
182 views

MOSS 2007 Permission error iterating users in group

The following code, though run with elevated privildges, redirects to an access denied error page saying "You are currently signed in as: (my non-admin account)." What am I doing wrong? ...
1
vote
3answers
2k views

SPSecurity.RunWithElevatedPrivileges working on Windows Server 2003/SP2007 and not on 2008/SP2010

I have this simple code in C# using sharepoint: SPSecurity.RunWithElevatedPrivileges(delegate() { SPSite site = new SPSite("http://localhost:333"); }); When i execute it on a Windows Server ...
7
votes
2answers
1k views

Thread Abort Issue with SharePoint SPWeb.Properties.Update()

I have a custom web service that runs in SharePoint 2007 as well as SharePoint 2010. I am currently testing only in SharePoint 2010 in my dev environment. I have some code that does the following: ...
0
votes
2answers
75 views

Run With Elevated Priv

Will RWEP add a file to a folder it has "Read" permissions for know sharepoint groups (but no sharepoint\system group added)?
1
vote
5answers
1k views

How to use SP Service Account to add an item (with object model)?

I can add an item to SharePoint (with the object model) when I am logged in to SharePoint with an administrative account. However, if I change to another user who is NOT listed in the backend SQL ...
3
votes
3answers
1k views

SPSecurity.RunWithElevatedPrivileges that elevates outside of the current web application context

Im not sure if this is possible without impersonating a user/service account (and therefore hard coding credentials) that has farm level access... The situation is I want to access an SPSite in ...
3
votes
5answers
2k views

RunWithElevatedPrivileges - Usage recommendations

I have a strong gut feeling that using SharePoint's RunWithElevatedPrivileges should be avoided like the plague, but need to convince some others as to exactly why. Here's what I have. Spawns a new ...