changeset 1735:eeb291c3f9b0

Configured imports: Allow sys_admin access to import_configuation.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 09 Jan 2019 15:53:48 +0100
parents 549337e6facd
children c88e758cb96c
files pkg/controllers/importconfig.go schema/auth.sql
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/importconfig.go	Wed Jan 09 15:41:29 2019 +0100
+++ b/pkg/controllers/importconfig.go	Wed Jan 09 15:53:48 2019 +0100
@@ -414,6 +414,7 @@
 
 	if err = tx.Commit(); err != nil {
 		scheduler.UnbindByID(id)
+		return
 	}
 
 	var result = struct {
--- a/schema/auth.sql	Wed Jan 09 15:41:29 2019 +0100
+++ b/schema/auth.sql	Wed Jan 09 15:53:48 2019 +0100
@@ -158,6 +158,10 @@
             SELECT country FROM users.list_users lu
             WHERE lu.username = waterway.import_configuration.username));
 
+CREATE POLICY import_configuration_policy_sys_admin ON waterway.import_configuration
+    FOR ALL TO sys_admin
+    USING (true);
+
 ALTER table waterway.import_configuration ENABLE ROW LEVEL SECURITY;
 
 COMMIT;