diff pkg/imports/report.go @ 5376:e09e003948c7 extented-report

Decouple and enforce roles in creating scheduled imports.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 24 Jun 2021 19:24:21 +0200
parents 755ed195fdc3
children d19fdf3d2099
line wrap: on
line diff
--- a/pkg/imports/report.go	Thu Jun 24 18:39:03 2021 +0200
+++ b/pkg/imports/report.go	Thu Jun 24 19:24:21 2021 +0200
@@ -27,6 +27,7 @@
 	"text/template"
 	"time"
 
+	"gemma.intevation.de/gemma/pkg/auth"
 	"gemma.intevation.de/gemma/pkg/common"
 	"gemma.intevation.de/gemma/pkg/config"
 	"gemma.intevation.de/gemma/pkg/misc"
@@ -84,6 +85,9 @@
 	return nil
 }
 
+// RequiresRoles enforces to be a sys_admin to run this .
+func (*Report) RequiresRoles() auth.Roles { return auth.Roles{"sys_admin"} }
+
 func (r *Report) Description() (string, error) { return r.Name, nil }
 
 func (*Report) CleanUp() error { return nil }