Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
56 views

Can I use elevated permissions using JSOM, CSOM, or REST?

I am working with an On-Premise SharePoint 2016 farm and I am looking for some way to elevate permissions, so I don't use the logged-in user's credentials but another set of permissions that the ...
1
vote
1answer
143 views

Are there any risks if we enable our workflow 2013 to run on elevated privileges (to use app permissions)

I am working on a SharePoint online site collection. We have a list which can only be viewed by certain users. But inside our workflow we want to be able to add items in this list and to be able to do ...
0
votes
1answer
46 views

Run JSOM with Site Collection Admin permission

Is it possible to run JSOM with Site Collection Admin permission anyhow?
0
votes
1answer
31 views

Create Content Database from Farm Application Page

This issue seems like it should be very easy to resolve, however it has taken hours and makes no sense. Case: Custom application page with simple form fields. When the form is filled out by user, ...
0
votes
1answer
25 views

Can we create a document with user having read permission only? C# SP2016

I am working with Visual WebPart in SP2016. I have created Farm Solution. I have a user TestUserRead. This user have read permission to the site. Can I create a document with TestUserRead using ...
2
votes
1answer
166 views

Running a remote event receivers in elevated privileges

I am currently migrating our server side event receivers to be remote event receivers. Now, one thing I can not find a way of doing it is how I can run part of my remote event receiver code in ...
1
vote
0answers
62 views

Event Receiver Fails (UnauthorzedAccessException) when item updated from using ElevatedPrivileges

I have small console application with this code: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(args[0])) { using (SPWeb web = site.OpenWeb()) ...
0
votes
1answer
72 views

Access Denied opening Web in elevated context

I am having a problem with a Visual Studio workflow where I am attempting to open the site from an elevated context and am getting an Access Denied exception. My current user is in the Farm ...
0
votes
1answer
339 views

SharePoint 2013 only Term Store admin can see the term

I have built a global navigation solution that replace the SuiteBarLinks and use a term store to store the links for the navigation. In my testing environment, Farm Account is granted to Term Store ...
0
votes
2answers
77 views

Open web in privileges mode and use it outside

I'm often using pattern where I create class Workspace. This class has some basic functionality and on of them is opening of webs, and also web in privilege mode: public class Workspace : IDisposable ...
0
votes
1answer
485 views

SP - C# Delete Item - Error message: 0x80070005 (E_ACCESSDENIED))

When i trying to delete listItem from list and anonymous access in site perm(for Fund3) is disabled my code throw exception. Where anonymous access is enable everything is OKAY-> items are deleted.......
3
votes
1answer
127 views

Cannot get Webs of SPSite object

I try to get all webs of an SPSite (via Powershell) on a SharePoint 2010. First I tried to get all the webs like this: $site = Get-SPSite http://<url> $webs = $site.AllWebs Every time tried ...
3
votes
1answer
98 views

Download file from library using RunWithElevatedPrivileges

I have a web part in which I am listing files from a library using RunWithElevatedPrivileges as user doesn't have any rights on that library (not even READ rights). But when user tries to download a ...
1
vote
0answers
208 views

Using RunWithElevatedPrivileges with ResultScriptWebPart

We're trying to run an extended ResultScriptWebPart search with elevated privileges so that all users of the system can search and see certain information without having access to those document ...
0
votes
1answer
257 views

acces denied when trying to get web.siteusers

I write a powershell script and when i try to get siteusers from certain SPWeb not all i have an access denied. My spweb object is correctly retrieve because i can display $web.Url $webapps = Get-...
-3
votes
2answers
34 views

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 ...
3
votes
2answers
1k views

Problem with RunWithElevatedPrivileges and Context

I'm trying to modify two properties I have in several documents in my SharePoint library. This is the code I use to get into the library: public SPArchiveBDI(string sharepointsite, string ...
0
votes
2answers
2k views

What is the command to elevate privileges in the Sharepoint Online (Office 365)?

What is the equivalent of the Farm Solution command to elevate privileges in the Sharepoint Online (Office 365) environment? In Farm Solution for Sharepoint on-premise, in server-side languages like C#...
1
vote
2answers
3k views

Add Run with elevated privileges in JSOM [duplicate]

I writing JSOM code to get interact with sharepoint 2013 lists and document libraries.Now I have requirement to allow anonymous users to insert the items for SharePoint Lists list. Can any one help ...
0
votes
2answers
379 views

RWEP in Event Receiver Item Added

Any idea why the follow code is not working in item added? Error: <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied. The code: SPSite site = new ...
2
votes
2answers
217 views

Need comments for code within SPSecurity.RunWithElevatedPrivileges

I am investigating the below code to make sure if its quality is as per Microsoft standards. Actually Comments came from Microsoft code reviewer that we need to create new SPSite Object within the ...
2
votes
1answer
54 views

RunWithElevatedPrivileges — with/without delegate

Here two methods below that uses SPSecurity.RunWithElevatedPrivileges(). I just want to know the difference between two? Method 1: public void Method1(SPUser user) { if (...
1
vote
1answer
446 views

'System.UnauthorizedAccessException' when accessing AllProperites if elevated web

Though the web is elevated, I get the following exception 'elevatedWeb.AllowAnonymousAccess' threw an exception of type 'System.UnauthorizedAccessException' when I try to access the elevated web ...
1
vote
1answer
153 views

How can I run SPService or RestService with contribute access?

Is there a way to run REST service or SPService in JQuery with Admin. privilege same like RunWithElevatedPrivilege. In DispForm.aspx there is a button. I want to add logged user who has read access ...
2
votes
1answer
284 views

Access Denied when access another site collection properties

I have two site collections: http://company - this is main portal http://company:200 - this is personal sites. On a personal sites collection, in its root web properties we stores Guid of main ...
0
votes
2answers
106 views

List View Threshold - Error

I have a custom aspx page used by Owners group (Full Control) that displays files that are checked out and files that have been uploaded but never checked in. We also have more than a few libraries ...
11
votes
2answers
744 views

Performing a search that is not security trimmed

I'm trying to documents of a certain content type that has a certain tagging (the documents are spread over several site collection). To get some performance I'm trying to do it with a KeywordQuery. ...
0
votes
1answer
40 views

Where should I insert SPSecurity.RunWithElevatedPrivileges?

I have an Application Page (.aspx) in which I get data from a List. I am fetching data from this List quite often in different scenarios. I have made a property in the code behind which gets me the ...
2
votes
4answers
574 views

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 ...
0
votes
0answers
155 views

Access Denied reading list with RunWithElevatedPrivileges

I am trying to read a list with a user without read permissions. I am using runWithElevatedPriviliges and I get this error: Access denied. You do not have permission to perform this action or ...
0
votes
0answers
60 views

Write-Output Powershell fails within RunWithElevatedPrivileges Block

This is possibly a heads-up as much as anything. I have found that if I write a Powershell with write-output statements, they do not appear when using RunWithElevatedPrivileges i.e Write-Output "...
2
votes
1answer
723 views

SPList.GetItemById and Checked Out Items

It seems I cannot use SPList.GetItemById(int) or SPList.GetItemByUniqueId(Guid) or Web.GetListItem(string) to get an item that is checked out. I have tried all three and all three result in a "File ...
0
votes
2answers
281 views

Need privileges to break inheritance

Idea is that inside an ItemAdded event receiver in a sandboxed solution (SharePoint Online) I want to set permissions on the item, which requires privileges that the user should not have on the list. ...
2
votes
1answer
710 views

Check user exist in active directory group without RunWithElevatedPrivileges

Yes I know it is duplicate question of this and this, but I want to check if user belongs to active directory group with out RunWithElevatedPrivileges. Is it possible? HttpContext.Current.User....
0
votes
1answer
149 views

Designer Workflow on Anonymous user

I have a public facing site with a "Contact Us" SharePoint list. Users are able to submit a new request through a custom Web Part which creates a SP List item using server side code. After the list ...
0
votes
1answer
165 views

Elevated Privileges

I am writing a Webpart for an on-premise SharePoint 2013. I need to persist data to a list with elevated privileges but still need to be able to keep track who changed and added items. When I view ...
0
votes
1answer
73 views

Strange Behaviour While Connecting to Database using SPSecurity.RunWithElevatedPriviledges

I am a beginner in Sharepoint. I have a stored procedured which needs to be executed when the user clicks on a button on the sharepoint page. The Click event is firing as expected but I get an error ...
0
votes
0answers
162 views

SPUtility.ValidateFormDigest breaks ASP.Net server side validation

I have a Web Part which is using SPSecurity.RunWithElevatedPrivileges, and thus needs to call SPUtility.ValidateFormDigest. However, this apparently causes it to ignore all ASP.Net validators server ...
1
vote
1answer
388 views

Permission issue creating site collection from service application

We have a custom service application set-up which is tasked with the creation of site collections. It uses the blank site template for this, on which we want to activate several of the out of the box ...
1
vote
1answer
1k views

Update current list item c#

When using a custom workflow activity with elevated privileges to create an item in a list. It creates two instead of one. What I am doing is that when a user create an item in the list . It displays ...
1
vote
1answer
299 views

Sharepoint 2010 fails to run elevated code as IIS pool identity account

I changed the IIS pool identity service account for my SharePoint 2010 web application thus replacing the default "Network Service" account (using SharePoint Administrator.) The pool service account ...
0
votes
2answers
809 views

runwithelevatedprivileges for sandbox

I'm new in sandbox and i'm developping an event receiver itemupdated and i need an alternative of runwithelevatedprivileges. I need it for using item.file.moveTo("new libraray url"); I need it ...
0
votes
2answers
270 views

Disable List Throttling through Server Object Model

I want to disable list throttling through code so i have written the following code SPList lstBookings = web.Lists.TryGetList("Bookings"); lstBookings.EnableThrottling = false; ...
0
votes
0answers
79 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 ...
0
votes
1answer
435 views

Security Validation Error

I'm trying to create a spweb in page_load via a control on the site. I get the error "The security validation for this page is invalid". I've got a postback (No GET-Request) and also tried SPUtility....
0
votes
1answer
131 views

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 ...
2
votes
2answers
2k views

How to check username/accountname under which the code runs?

We want piece of code which we can paste in the code behind and get the username under which code runs for:- (usually .NET code runs under account of application pool) Timer job. Event receiver. ...
2
votes
3answers
6k views

Application page in layouts folder accessing web application object

There is an application page, deployed to the layouts folder. The URL of the app page is: http://server:port/sc2/_layouts/test/mypage.aspx Now, there is a user with read only permissions (added to ...
1
vote
1answer
1k views

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 ...
1
vote
1answer
949 views

Can SPPersistedObject settings be updated by normal users if ran with elevated privileges?

I have a custom ribbon icon "Enlist" deployed to each document library. A normal (i.e. non-admin) user can click this icon; when he does, I would like to permanently save the document library ...