0
votes

I need to implement sharepoint search using query web service in javascript. I am able to do it but the results I am getting are not security trimmed. Users can see even those files which are not accessible to them (i.e. they dont have permission to view those files).
My questions are:

  1. How to get security trimmed results when using query web service in javascript?
  2. Is there any other way to perform search and get security trimmed results?

Many thanks.

1

1 Answers

0
votes

As long as the query is being made from the users account/role (user is logged in and accesses a page with a query webpart, etc), that query should only return the security trimmed results. SharePoint's webservice handles the security trimming by default.

However,if you write a custom query and elevate privileges in your code, such as using the SPSETUP account, then you will get non-user specific results. This is bad practice for the majority of scenarios.