I have a webscript that does a search query like so:
params.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
params.setQuery("a simple lucene query");
ResultSet result = this.searchService.query(params);
The search works great except that it does not respect the persmissions of the respective user. It returns items the user is not allowed to see. The description of the webscript is as follows:
<webscript>
<shortname>Search the repository</shortname>
<description></description>
<url>/myPackage/search</url>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>
I checked the SOAP API which uses pretty much the same call
StoreRef storeRef = Utils.convertToStoreRef(store);
searchResults = searchService.query(storeRef, query.getLanguage(), statement);
There the permissions are checked. So this should not be a configuration issue.How can I make the webscript respect the users' persmissions?