Commit 41108ba2 authored by Daniel Haag's avatar Daniel Haag
Browse files

Merge branch '160628a' into 'uibk'

fixed some errors in sql



See merge request !68
parents 9c662978 986aa705
-- modifying the schema to allow an external_id
ALTER TABLE tce_user_groups ADD COLUMN external_id varchar(255);
......@@ -179,11 +180,10 @@ ALTER FUNCTION get_tcexam_group_users(character varying)
-- get tcexam_user
CREATE OR REPLACE FUNCTION get_tcexam_user(userid character varying)
RETURNS text
AS $function$
RETURNS text AS
$function$
DECLARE
xoutput text;
xoutput text;
BEGIN
SELECT XMLSERIALIZE ( CONTENT
......@@ -200,15 +200,15 @@ SELECT XMLSERIALIZE ( CONTENT
))) as text )
INTO xoutput
FROM tce_users u
WHERE u.user_name = userid
;
WHERE u.user_name = userid;
RETURN xoutput;
END;
$function$
LANGUAGE plpgsql
LANGUAGE plpgsql VOLATILE
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
ALTER FUNCTION get_tcexam_user(character varying)
OWNER TO tcexam;
-- insert_tcexam_group
......@@ -235,15 +235,15 @@ $BODY$
SECURITY DEFINER
-- Set a secure search_path: trusted schema(s), then 'pg_temp'.
SET search_path = tcexam, pg_temp;
ALTER FUNCTION insert_tcexam_group(text, character varying, character varying, character varying)
ALTER FUNCTION insert_tcexam_group(character varying, character varying, character varying)
OWNER TO tcexam;
-- insert_tcexam_user
CREATE OR REPLACE FUNCTION insert_tcexam_user(xmlbody text)
RETURNS void
AS $function$
RETURNS void AS
$function$
DECLARE
login character varying;
email character varying;
......@@ -269,10 +269,9 @@ AS $function$
END;
$function$
LANGUAGE plpgsql
LANGUAGE plpgsql VOLATILE
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
ALTER FUNCTION insert_tcexam_user(text)
OWNER TO tcexam;
......@@ -353,8 +352,8 @@ ALTER FUNCTION update_tcexam_group(character varying, character varying, charact
-- update_tcexam_user
CREATE OR REPLACE FUNCTION update_tcexam_user(xmlbody text)
RETURNS void
AS $function$
RETURNS void AS
$function$
DECLARE
login character varying;
email character varying;
......@@ -394,11 +393,10 @@ AS $function$
END;
$function$
LANGUAGE plpgsql
LANGUAGE plpgsql VOLATILE
SECURITY DEFINER
SET search_path TO tcexam, pg_temp;
ALTER FUNCTION update_tcexam_user(text)
OWNER TO tcexam;
......@@ -434,13 +432,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 +458,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 +505,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 +531,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 +547,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