changeset 5366:cb46f50ba168 extented-report

Allow /api/imports/report only to sysadmins.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 23 Jun 2021 12:10:25 +0200
parents 74bae79de83e
children 1695e17c5a83
files pkg/controllers/routes.go
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/routes.go	Wed Jun 23 12:05:05 2021 +0200
+++ b/pkg/controllers/routes.go	Wed Jun 23 12:10:25 2021 +0200
@@ -256,7 +256,6 @@
 		"fm_rtpbcn",
 		"fm_topmar",
 		"fm_notmrk",
-		"report",
 	}, "|")
 
 	api.Handle("/imports/{kind:"+kinds+"}", waterwayAdmin(&mw.JSONHandler{
@@ -265,6 +264,12 @@
 		NoConn: true,
 	})).Methods(http.MethodPost)
 
+	api.Handle("/imports/{kind:report}", sysAdmin(&mw.JSONHandler{
+		Input:  importModel,
+		Handle: manualImport,
+		NoConn: true,
+	})).Methods(http.MethodPost)
+
 	// Import scheduler configuration
 	api.Handle("/imports/config/{id:[0-9]+}/run",
 		waterwayAdmin(&mw.JSONHandler{