Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
Expand All @@ -63,11 +64,11 @@ public class WFSHarvesterApi {
produces = MediaType.APPLICATION_JSON_VALUE,
method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.OK)
@PreAuthorize("hasAuthority('Editor')")
@ResponseBody
public JSONObject indexWfs(
@RequestBody WFSHarvesterParameter config) throws Exception {

// TODO: Check user is authenticated ?
JSONObject result = new JSONObject();
result.put("success", true);
result.put("indexedFeatures",
Expand All @@ -85,6 +86,7 @@ public JSONObject indexWfs(
produces = MediaType.ALL_VALUE,
method = RequestMethod.DELETE)
@ResponseStatus(value = HttpStatus.OK)
@PreAuthorize("hasAuthority('Editor')")
@ResponseBody
public JSONObject deleteWfs(
@RequestParam
Expand All @@ -95,12 +97,9 @@ public JSONObject deleteWfs(
EsWFSFeatureIndexer indexer = ApplicationContextHolder.get().getBean(EsWFSFeatureIndexer.class);
indexer.deleteFeatures(serviceUrl, typeName, client);

// TODO: Check user is authenticated ?
JSONObject result = new JSONObject();
result.put("success", true);
// result.put("indexedFeatures",
// sendMessage(config));


return result;
}

Expand Down
Loading