Mercurial > gemma
view schema/manage_users.sql @ 209:9585982180ab
Remove obsolete TODO comment
Users can write in this table only through user management
functions which ensure consistency.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 23 Jul 2018 16:14:36 +0200 |
parents | 88d21c29cf04 |
children | 229f385448fa |
line wrap: on
line source
-- -- Functions encapsulating user management functionality and -- exposing it to privileged users -- CREATE OR REPLACE FUNCTION sys_admin.create_user( userrole varchar, username users.user_profiles.username%TYPE, pw varchar, 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 users.user_profiles VALUES ( username, country, map_extent, email_adress); EXECUTE format( 'CREATE ROLE %I IN ROLE %I LOGIN PASSWORD %L', username, userrole, pw); END; $$ LANGUAGE plpgsql SECURITY DEFINER;