How to use SharePoint search query with SharePoint Granular access permissions?

Copper Contributor

I want to execute SharePoint search API with granular access for that I've changed
'Sites.ReadWrite.All' permission to 'Sites.Selected' permission, so that application would have all sites access but during search I'm getting unauthorize error
{"odata.error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message":{"lang":"en-US","value":"Unauthorized."}}}

Also tried to give sites.selected permission at tenant level, that also not works, if the only solution is to give 'Sites.ReadWrite.All' or 'Sites.Read' then there is no use of granular level access implementation Sites.Read.all will allow all sites if granted.


My query is similar to below -:'*+AND+(Path:"" OR Path:"")'&trimDuplicates=false&selectProperties='Column1,Column2'&refiners='Column1OWSTEXT'&refinementFilters='Column1:equals(\"xxxxx\")'&rowLimit=5


Some other references regarding my question.


Really appreciate any response on this or alternative approach to to achieve this.


0 Replies