Commit 8feba73f authored by User expired's avatar User expired
Browse files

corrections to postgres functions install file

parent 9c662978
-- modifying the schema to allow an external_id
ALTER TABLE tce_user_groups ADD COLUMN external_id varchar(255);
......@@ -180,6 +181,9 @@ ALTER FUNCTION get_tcexam_group_users(character varying)
-- get tcexam_user
CREATE OR REPLACE FUNCTION get_tcexam_user(userid character varying)
RETURNS text
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp
AS $function$
DECLARE
......@@ -205,9 +209,7 @@ WHERE u.user_name = userid
RETURN xoutput;
END;
$function$
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
-- insert_tcexam_group
......@@ -243,6 +245,9 @@ ALTER FUNCTION insert_tcexam_group(text, character varying, character varying, c
CREATE OR REPLACE FUNCTION insert_tcexam_user(xmlbody text)
RETURNS void
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp
AS $function$
DECLARE
login character varying;
......@@ -269,9 +274,6 @@ AS $function$
END;
$function$
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
ALTER FUNCTION insert_tcexam_user(text)
OWNER TO tcexam;
......@@ -354,6 +356,9 @@ ALTER FUNCTION update_tcexam_group(character varying, character varying, charact
CREATE OR REPLACE FUNCTION update_tcexam_user(xmlbody text)
RETURNS void
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp
AS $function$
DECLARE
login character varying;
......@@ -394,10 +399,6 @@ AS $function$
END;
$function$
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
ALTER FUNCTION update_tcexam_user(text)
OWNER TO tcexam;
......@@ -434,13 +435,10 @@ $BODY$
RETURN xoutput;
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER;
ALTER FUNCTION get_tcexam_recent_tests(character varying) SET search_path=tcexam, pg_temp;
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
SET search_path = tcexam, pg_temp;
ALTER FUNCTION get_tcexam_recent_tests(character varying) OWNER TO tcexam;
GRANT EXECUTE ON FUNCTION get_tcexam_recent_tests(character varying) TO public;
GRANT EXECUTE ON FUNCTION get_tcexam_recent_tests(character varying) TO tcexam;
GRANT EXECUTE ON FUNCTION get_tcexam_recent_tests(character varying) TO esb;
-- Function: set_tcexam_email_sent(character varying, integer)
......@@ -463,12 +461,11 @@ BEGIN
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER;
ALTER FUNCTION set_tcexam_email_sent(character varying, integer) SET search_path=tcexam, pg_temp;
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
SET search_path = tcexam, pg_temp;
ALTER FUNCTION set_tcexam_email_sent(character varying, integer) OWNER TO tcexam;
GRANT EXECUTE ON FUNCTION set_tcexam_email_sent(character varying, integer) TO public;
GRANT EXECUTE ON FUNCTION set_tcexam_email_sent(character varying, integer) TO tcexam;
GRANT EXECUTE ON FUNCTION set_tcexam_email_sent(character varying, integer) TO esb;
-- Function: count_tcexam_users_by_exam(character varying, character varying)
......@@ -511,12 +508,10 @@ END;
$BODY$
LANGUAGE plpgsql VOLATILE;
ALTER FUNCTION count_tcexam_users_by_exam(character varying, character varying) SET search_path=tcexam, pg_temp;
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
SET search_path = tcexam, pg_temp;
ALTER FUNCTION count_tcexam_users_by_exam(character varying, character varying) OWNER TO tcexam;
GRANT EXECUTE ON FUNCTION count_tcexam_users_by_exam(character varying, character varying) TO public;
GRANT EXECUTE ON FUNCTION count_tcexam_users_by_exam(character varying, character varying) TO tcexam;
GRANT EXECUTE ON FUNCTION count_tcexam_users_by_exam(character varying, character varying) TO esb;
-- Function: get_tcexam_groupid(character varying, character varying)
......@@ -539,13 +534,10 @@ SELECT XMLSERIALIZE ( CONTENT
RETURN groupid;
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER;
ALTER FUNCTION get_tcexam_groupid(character varying, character varying) SET search_path=tcexam, pg_temp;
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
SET search_path = tcexam, pg_temp;
ALTER FUNCTION get_tcexam_groupid(character varying, character varying) OWNER TO tcexam;
GRANT EXECUTE ON FUNCTION get_tcexam_groupid(character varying, character varying) TO public;
GRANT EXECUTE ON FUNCTION get_tcexam_groupid(character varying, character varying) TO tcexam;
GRANT EXECUTE ON FUNCTION get_tcexam_groupid(character varying, character varying) TO esb;
-- create esb user
......@@ -558,17 +550,18 @@ GRANT EXECUTE ON FUNCTION get_tcexam_groupid(character varying, character varyin
-- # grep 'CREATE OR REPLACE FUNCTION' postgres_db_structure_functions.sql | sed 's/CREATE OR REPLACE FUNCTION //' | while read f; do echo "GRANT EXECUTE ON FUNCTION $f TO esb;"; done
GRANT EXECUTE ON FUNCTION assign_tcexam_user_to_group(xmlbody text, pgroupid character varying, pappointmentid character varying) TO esb;
GRANT EXECUTE ON FUNCTION count_tcexam_users_by_exam(external_group_id character varying, external_appointment_id character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_group(externalid character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_group_appointment_users(pgroupid character varying, pappointmentid character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_group_users(group_id character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_groupid(pgroupid character varying, pappointmentid character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_recent_tests(externalid character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_user(userid character varying) TO esb;
GRANT EXECUTE ON FUNCTION insert_tcexam_group(pgroupid character varying, pappointmentid character varying, pgroupname character varying) TO esb;
GRANT EXECUTE ON FUNCTION insert_tcexam_user(xmlbody text) TO esb;
GRANT EXECUTE ON FUNCTION remove_tcexam_user_from_group(xmlbody text, pgroupid character varying, pappointmentid character varying) TO esb;
GRANT EXECUTE ON FUNCTION set_tcexam_email_sent(groupid character varying, emailnumber integer) TO esb;
GRANT EXECUTE ON FUNCTION set_tcexam_user_level(login character varying, ulevel integer) TO esb;
GRANT EXECUTE ON FUNCTION update_tcexam_group(pgroupid character varying, pappointmentid character varying, pgroupname character varying) TO esb;
GRANT EXECUTE ON FUNCTION update_tcexam_user(xmlbody text) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_recent_tests(externalid character varying) TO esb;
GRANT EXECUTE ON FUNCTION set_tcexam_email_sent(groupid character varying, emailnumber integer) TO esb;
GRANT EXECUTE ON FUNCTION count_tcexam_users_by_exam(external_group_id character varying, external_appointment_id character varying) TO esb;
GRANT EXECUTE ON FUNCTION get_tcexam_groupid(pgroupid character varying, pappointmentid character varying) TO esb;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment