0

I want to retrieve all the library items of a content type "Prod Request". I am using REST API.

Here is my query:

$.ajax({               
    url: https://mysite.domain.com/_api/search/query?querytext='contenttype:Prod Request'&rowlimit=100&trimduplicates=false&selectproperties='Title',
    method: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" 
 },
    success: function (data) {...........

The problem which I am facing is if I login with Farm account it return all results(5000 items) but if I login with SiteCollection Admin account it only returns 35 items and do not return other items to which site collection admin has access.

Please assist.

0

REST API calls are still based on permissions as to what you will be able to use when it is invoked. This sounds like a permissions issue. You are SCA sure but you do not own the WFE. So this is why the Farm Admins can see everything and SCA cannot.

We can map user permissions with role definitions

  1. Full Control - Has full control - User can make any call under endpoint "_api/web"

  2. Edit - Can add, edit and delete lists; can view, add, update and delete list items and documents. - User Can do any operation on list and list items and end point would be "_api/web/Lists"

  3. Read - Can view pages and list items and download documents. - User can do Get operations on list items and end point would be "_api/web/Lists/getByTitle('')/Items

Since your call is just using the _api endpoint, the permissions go up just like the others. You will not be able to see anything as SCA unless it is using the _api/web end point. At least not everything.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.