diff schema/manage_users.sql @ 195:5dc8e734487a

Introduce database schemas as privilege-based namespaces Some privileges changed (e.g. for responsibility_areas), but additional privileges were not left off intentionally before. Search path settings have been replaced by schema-qualifying names in statements to prevent object definitions from being dependend on search path settings.
author Tom Gottfried <tom@intevation.de>
date Fri, 20 Jul 2018 17:28:16 +0200
parents a9d9c2b1d08c
children 88d21c29cf04
line wrap: on
line diff
--- a/schema/manage_users.sql	Fri Jul 20 18:32:40 2018 +0200
+++ b/schema/manage_users.sql	Fri Jul 20 17:28:16 2018 +0200
@@ -3,18 +3,18 @@
 -- exposing it to privileged users
 --
 
-CREATE OR REPLACE FUNCTION create_user(
+CREATE OR REPLACE FUNCTION sys_admin.create_user(
        userrole varchar,
-       username user_profiles.username%TYPE,
+       username users.user_profiles.username%TYPE,
        pw varchar,
-       country user_profiles.country%TYPE,
-       map_extent user_profiles.map_extent%TYPE,
-       email_adress user_profiles.email_adress%TYPE
+       country users.user_profiles.country%TYPE,
+       map_extent users.user_profiles.map_extent%TYPE,
+       email_adress users.user_profiles.email_adress%TYPE
     )
     RETURNS void
 AS $$
 BEGIN
-    INSERT INTO user_profiles VALUES (
+    INSERT INTO users.user_profiles VALUES (
         username, country, map_extent, email_adress);
     EXECUTE format(
         'CREATE ROLE %I IN ROLE %I LOGIN PASSWORD %L', username, userrole, pw);