From b48cd61f3045b7483fd3245ceb8329f49931c06e Mon Sep 17 00:00:00 2001 From: Michael Lavrisha Date: Fri, 4 Dec 2020 22:12:21 -0700 Subject: [PATCH] Move database permissions to their own changeset Add the LIQUIBASE_CONTEXTS=dlcs-permissions env var to add the postgres permissions to your db. Tested with an existing db, a fresh db with dlcs-permissions enabled, and a fresh db without dlcs-permissions. Also bumps xsd liquibase version to match maven version (3.6) --- .../config/RepositoryConfig.java | 1 + .../database/liquibase-changelog.xml | 301 ++++++------------ .../sql/functions/annotation_body_create.sql | 5 - .../sql/functions/annotation_body_delete.sql | 5 - .../annotation_collection_create.sql | 5 - .../sql/functions/annotation_create.sql | 5 - .../functions/annotation_creator_create.sql | 5 - .../functions/annotation_creator_delete.sql | 5 - .../annotation_css_selector_create.sql | 5 - .../annotation_css_selector_delete.sql | 5 - ...notation_data_position_selector_create.sql | 5 - ...notation_data_position_selector_delete.sql | 5 - .../sql/functions/annotation_delete.sql | 5 - .../annotation_fragment_selector_create.sql | 5 - .../annotation_fragment_selector_delete.sql | 5 - .../functions/annotation_generator_create.sql | 5 - .../functions/annotation_generator_delete.sql | 5 - .../functions/annotation_history_create.sql | 5 - .../functions/annotation_history_delete.sql | 5 - .../functions/annotation_search_by_body.sql | 5 - .../annotation_search_by_creator.sql | 5 - .../annotation_search_by_generator.sql | 5 - .../functions/annotation_search_by_target.sql | 5 - .../annotation_search_by_temporal.sql | 5 - .../annotation_svg_selector_create.sql | 5 - .../annotation_svg_selector_delete.sql | 5 - .../functions/annotation_target_create.sql | 5 - .../functions/annotation_target_delete.sql | 5 - .../functions/annotation_temporal_create.sql | 5 - .../functions/annotation_temporal_delete.sql | 5 - ...notation_text_position_selector_create.sql | 5 - ...notation_text_position_selector_delete.sql | 5 - .../annotation_text_quote_selector_create.sql | 5 - .../annotation_text_quote_selector_delete.sql | 5 - .../sql/functions/annotation_update.sql | 5 - .../annotation_xpath_selector_create.sql | 5 - .../annotation_xpath_selector_delete.sql | 5 - ..._add_annotation_search_security_fields.sql | 5 - .../v002/01_fix_annotation_delete.sql | 5 - .../02_fix_annotation_search_by_creator.sql | 5 - .../03_fix_annotation_search_by_generator.sql | 5 - .../04_fix_annotation_search_by_target.sql | 5 - .../05_fix_annotation_search_by_temporal.sql | 5 - .../v002/06_fix_annotation_search_by_body.sql | 5 - .../v002/07_fix_annotation_update.sql | 5 - .../permissions/annotations_permissions.sql | 72 +++++ .../sql/permissions/postgres_permissions.sql | 142 +++++++++ .../sql/permissions/public_permissions.sql | 43 +++ .../database/sql/tables/annotation.sql | 3 - .../database/sql/tables/annotation_agent.sql | 3 - .../sql/tables/annotation_agent_email.sql | 3 - .../tables/annotation_agent_email_sha1.sql | 3 - .../sql/tables/annotation_agent_homepage.sql | 3 - .../sql/tables/annotation_agent_name.sql | 3 - .../sql/tables/annotation_agent_type.sql | 3 - .../database/sql/tables/annotation_body.sql | 3 - .../sql/tables/annotation_collection.sql | 3 - .../sql/tables/annotation_history.sql | 4 - .../sql/tables/annotation_selector.sql | 3 - .../database/sql/tables/annotation_target.sql | 3 - .../sql/tables/annotation_temporal.sql | 3 - .../sql/views/annotation_body_get.sql | 4 - .../sql/views/annotation_collection_get.sql | 4 - .../sql/views/annotation_creator_get.sql | 4 - .../sql/views/annotation_css_selector_get.sql | 4 - .../annotation_data_position_selector_get.sql | 4 - .../annotation_fragment_selector_get.sql | 4 - .../sql/views/annotation_generator_get.sql | 4 - .../database/sql/views/annotation_get.sql | 4 - .../sql/views/annotation_history_get.sql | 4 - .../sql/views/annotation_svg_selector_get.sql | 4 - .../sql/views/annotation_target_get.sql | 4 - .../sql/views/annotation_temporal_get.sql | 4 - .../annotation_text_position_selector_get.sql | 4 - .../annotation_text_quote_selector_get.sql | 4 - .../views/annotation_xpath_selector_get.sql | 4 - .../resources/eludicate-server.properties | 1 + 77 files changed, 356 insertions(+), 519 deletions(-) create mode 100644 elucidate-server/src/main/resources/database/sql/permissions/postgres_permissions.sql create mode 100644 elucidate-server/src/main/resources/database/sql/permissions/public_permissions.sql diff --git a/elucidate-server/src/main/java/com/digirati/elucidate/infrastructure/config/RepositoryConfig.java b/elucidate-server/src/main/java/com/digirati/elucidate/infrastructure/config/RepositoryConfig.java index ca6cb453..8fd41d8f 100644 --- a/elucidate-server/src/main/java/com/digirati/elucidate/infrastructure/config/RepositoryConfig.java +++ b/elucidate-server/src/main/java/com/digirati/elucidate/infrastructure/config/RepositoryConfig.java @@ -31,6 +31,7 @@ public SpringLiquibase liquibaseMigrations() throws PropertyVetoException { SpringLiquibase liquibase = new SpringLiquibase(); liquibase.setDataSource(dataSource()); liquibase.setChangeLog("classpath:database/liquibase-changelog.xml"); + liquibase.setContexts(environment.getRequiredProperty("liquibase.contexts", String.class)); return liquibase; } diff --git a/elucidate-server/src/main/resources/database/liquibase-changelog.xml b/elucidate-server/src/main/resources/database/liquibase-changelog.xml index 94020dce..4c2bca58 100644 --- a/elucidate-server/src/main/resources/database/liquibase-changelog.xml +++ b/elucidate-server/src/main/resources/database/liquibase-changelog.xml @@ -3,438 +3,313 @@ + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - + - - - + + + select rolcreaterole from pg_roles where rolname = (select current_user); + + + + + + + - - - + 8:5a82d9257451978664d4c95b19d2e04b - - - + 8:ad39ddf8b5401f24211fa30addb1677c - - - + 8:352036887b861494aa9b3be355497903 - - - + 8:64a882ffc0b572c34aad9958a8ae00c6 - - - + 8:b3e84edc16a2ec1c572442a61a8846e3 - - - + 8:3ff69bec5bba89add375bf505aee9774 - - - + 8:7f17f9ef86300ea21fa771dcfa2ed8d7 - - - + 8:9aa46006532f691ec4c19b47ecd3378a - - - + 8:b67bb1f770506bf44a4987d293813315 - - - + 8:ee627d559d209d35491f6652e1450f25 - - - + 8:b5eb97580968c2a5e9e7e7f8568ef245 - - - + 8:a33c9a066bc57a5a9109f280bb7fe801 - - - + 8:469c30706dafb42c6092b5358c5a51d1 - - - + 8:9679710974b986ab9a493855e40f36d5 - - - + 8:95aa74fc85b20bb2aef98bee89688acd - - - + 8:28b61a438e644583467004bcdbbe6135 - - - + 8:4865938b1273f082e806da07e19f5c9c - - - + 8:0d64abfe8a524deb14f8ba669ea96837 - - - + 8:962033ef79688b9a2c196a52016cd3d4 - - - + 8:225300ea860b31baeda63dc82a9c824f - - - + 8:34b23ecc9f1789593ea6522e5f301fd1 - - - + 8:83e6f722a7868fe5533587e9e5ed7f86 - - - + 8:5151bfbe5709d51675d5897de78adf3a - - - + 8:04577c21a2d8dc3abcdbf094d5f2c9e9 - - - + 8:89301c93a93cb64b1b7f57cfe9070a3b - - - + 8:ce9f88aadb56d198911ddfc454d014c2 - - - + 8:d993e707c439bbfc8b4a24c0e8c9b609 - - - + 8:027934ddab1f05618b4b34daf6e9f54e - - - + 8:e2a973f0522581cb1b3e1d3ae1f4061b - - - + 8:f9ce1af0258d8ef826dfbdb7cf5d83af - - - + 8:fe39f740218aeffea1c562f8a05f7080 - - - + 8:dfcaaec95746f7f89ef7bba8da97b304 - - - + 8:3a87a2627a7bee9bce1e873e44211fc7 - - - + 8:19699781d6cfcd98e71e8b310f096a7d - - - + 8:519e8cebdc806d02d1f9001606143c68 - - - + 8:731a903579a3812ff3fcf3db8b60fd6c - - - + 8:f8179a1597fc70ee7b106bfd047a0c3f - - - + 8:6094546d42dba74198dd5717c0da3482 - - - + 8:bf4bcb6c7429aaf868a2ff5a58b9feae - - - + 8:c620fdb9d3e5cccaaddf2fda285f8bda - - - + 8:583b2308727fc7e0206575c9be98d44a - - - + 8:52321e49a91b62942414ffda5cd1f40c - - - + 8:2a5b9a053a3aaf12371cf6f3e8fbcc6f - - - + 8:69e0fa4f24a521301e9545f1b69a11ef - - - + 8:dc948675c0adbfc8be9835122fa6df38 - - - + 8:b77dfd6aa9068d0d1d00414219f9e6a8 - - - + 8:a1f4079a65803025056acdf4df280dc3 - - - + 8:bd176d3891d5ab8347a99932499bb65b - - - + 8:8dfdd20e25f40aa0a4b2c4a2e71b021a - - - + 8:01259336de9d56cb07e4340c23909198 - - - + 8:2d3af21ec675b2d98877ae1eed2f5084 - - - + 8:7b1e16359e4bf0160c8218bf29d54ac5 - - - + 8:0ab4d4d13f987bbe5781f90c0da0a7b1 - - - + 8:579caa54061abfb661323e995651aefd - - - + 8:a65e9e65ea8756777e16b7de632b6248 - - - + 8:d5967c71da9c3bb3db96296b0cb8df45 - - - + 8:ff846c205ce8d9d67b20199fb456f4f0 - - - + 8:67329f2e8969b21a93bba9055862f46b - - - + 8:6e2e52e6c7ccf8443bb12a26a69171bf - - - + 8:29b43d1ce1dc59f895906c7d72e1a0e0 - - - + 8:9c951ad9a458191b09a52baee4358376 - - - + 8:4c0b589877d5ceb1b42aff9bb607fd46 - - - + 8:79852eb73838648e8b7a749478a6e04e - - - + 8:52321e49a91b62942414ffda5cd1f40c - - - + 8:69e0fa4f24a521301e9545f1b69a11ef - - - - + + 8:e6ef50783e3cae30197449fcc6eb8f74 @@ -446,6 +321,7 @@ path="sql/migrations/v001/02_add_annotation_get_security_fields.sql"/> + 8:a66f2f512c16a24e7faa74b64109bba1 @@ -461,38 +337,55 @@ path="sql/migrations/v001/05_add_annotation_security_collection.sql"/> + 8:1487376f2e7283d828230092f1cbb1ce + 8:2c0c5aea3dea78f830f94422fc2cb9df + 8:0632d822bb537de5d22c99393cfe9776 + 8:444383e424cc59c91a3286c910228e2f + 8:be3a1e3ff1f67c40d44b741cac0578ed + 8:c67855fec05e888d83645d274e3eda62 + 8:dbe26215ce3a479bfe5992bc7f9fb25a + + + + + + diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_body_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_body_create.sql index 445a6883..e355cd08 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_body_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_body_create.sql @@ -48,8 +48,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_body_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_body_delete.sql index 2aaae5a4..abe2a896 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_body_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_body_delete.sql @@ -36,8 +36,3 @@ FROM END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_body_delete(integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_body_delete(integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_collection_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_collection_create.sql index 0e9b0f6d..2dde8374 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_collection_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_collection_create.sql @@ -41,8 +41,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_collection_create(character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_collection_create(character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_create.sql index 99653636..291b8d4f 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_create.sql @@ -56,8 +56,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_create(character varying, character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_create(character varying, character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_create.sql index 063c98b6..f73bab4e 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_create.sql @@ -180,8 +180,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_delete.sql index 2cbd7832..ed15d982 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_creator_delete.sql @@ -75,8 +75,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_creator_delete(integer, integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_creator_delete(integer, integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_create.sql index 4a3d0d1c..3afd27f6 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_create.sql @@ -60,8 +60,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_delete.sql index 5dac1e11..527721a0 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_delete.sql @@ -49,8 +49,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_css_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_css_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_create.sql index 991b296d..6d1939dd 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_create.sql @@ -64,8 +64,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_delete.sql index f1522795..2c441eee 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_data_position_selector_delete.sql @@ -50,8 +50,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_data_position_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_delete.sql index 3d8afffa..a7d2609e 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_delete.sql @@ -50,8 +50,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_delete(character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_delete(character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_create.sql index 9f4ce906..34bff202 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_create.sql @@ -88,8 +88,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_delete.sql index e59dbdff..24fffa37 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_fragment_selector_delete.sql @@ -56,8 +56,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_fragment_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_create.sql index f29c2f70..1ef8da73 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_create.sql @@ -180,8 +180,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_delete.sql index dfe9c572..5d3256b8 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_generator_delete.sql @@ -75,8 +75,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_generator_delete(integer, integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_generator_delete(integer, integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_generator_delete(integer, integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_generator_delete(integer, integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_history_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_history_create.sql index 31687df2..34746041 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_history_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_history_create.sql @@ -51,8 +51,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_history_create(integer, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_history_create(integer, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_history_create(integer, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_history_create(integer, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_history_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_history_delete.sql index 361605f4..e243af14 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_history_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_history_delete.sql @@ -43,8 +43,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_history_delete(integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_history_delete(integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_history_delete(integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_history_delete(integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_body.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_body.sql index 9e2a4fcf..a6a2242d 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_body.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_body.sql @@ -124,8 +124,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_creator.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_creator.sql index 2a3d75e2..8ba331e8 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_creator.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_creator.sql @@ -258,8 +258,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_generator.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_generator.sql index 04c03e16..bee1a09a 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_generator.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_generator.sql @@ -258,8 +258,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_target.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_target.sql index 335115d7..1c221dcc 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_target.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_target.sql @@ -124,8 +124,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_temporal.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_temporal.sql index 8a078c87..e556a0c2 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_temporal.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_search_by_temporal.sql @@ -121,8 +121,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_create.sql index c11ee761..f0615690 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_create.sql @@ -60,8 +60,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_delete.sql index 7424cbb4..36953eb5 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_svg_selector_delete.sql @@ -49,8 +49,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_svg_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_svg_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_target_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_target_create.sql index 8a43df00..1fa06ffa 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_target_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_target_create.sql @@ -48,8 +48,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_target_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_target_delete.sql index 9312d5f3..e3d5d2b4 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_target_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_target_delete.sql @@ -36,8 +36,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_target_delete(integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_target_delete(integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_target_delete(integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_target_delete(integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_create.sql index 5b349d6b..d3d127a8 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_create.sql @@ -61,8 +61,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_delete.sql index e5f36d09..d0fa87c6 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_temporal_delete.sql @@ -54,8 +54,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_temporal_delete(integer, integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_create.sql index 99bc4718..5d46e781 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_create.sql @@ -64,8 +64,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_delete.sql index 8aa8b169..8a7659b9 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_position_selector_delete.sql @@ -50,8 +50,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_text_position_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_create.sql index 7da837a2..e582d6f8 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_create.sql @@ -66,8 +66,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_delete.sql index 04ec5e9c..16dd915b 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_text_quote_selector_delete.sql @@ -51,8 +51,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_text_quote_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_update.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_update.sql index df646499..3be7a477 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_update.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_update.sql @@ -54,8 +54,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_update(character varying, character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_update(character varying, character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_create.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_create.sql index 501822ac..5e5eac61 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_create.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_create.sql @@ -60,8 +60,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_delete.sql b/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_delete.sql index 36518e87..fe1c40cf 100644 --- a/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/functions/annotation_xpath_selector_delete.sql @@ -49,8 +49,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_xpath_selector_delete(integer, integer) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v001/03_add_annotation_search_security_fields.sql b/elucidate-server/src/main/resources/database/sql/migrations/v001/03_add_annotation_search_security_fields.sql index 6a19e9ab..501a96f1 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v001/03_add_annotation_search_security_fields.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v001/03_add_annotation_search_security_fields.sql @@ -128,8 +128,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/01_fix_annotation_delete.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/01_fix_annotation_delete.sql index 7287077b..8eda8305 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/01_fix_annotation_delete.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/01_fix_annotation_delete.sql @@ -54,8 +54,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_delete(character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_delete(character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/02_fix_annotation_search_by_creator.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/02_fix_annotation_search_by_creator.sql index 3724ac77..efc60118 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/02_fix_annotation_search_by_creator.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/02_fix_annotation_search_by_creator.sql @@ -262,8 +262,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/03_fix_annotation_search_by_generator.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/03_fix_annotation_search_by_generator.sql index 97f244a7..9321d676 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/03_fix_annotation_search_by_generator.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/03_fix_annotation_search_by_generator.sql @@ -262,8 +262,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/04_fix_annotation_search_by_target.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/04_fix_annotation_search_by_target.sql index 068801b7..fb1bb577 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/04_fix_annotation_search_by_target.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/04_fix_annotation_search_by_target.sql @@ -128,8 +128,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/05_fix_annotation_search_by_temporal.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/05_fix_annotation_search_by_temporal.sql index c0937f62..45f2dcec 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/05_fix_annotation_search_by_temporal.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/05_fix_annotation_search_by_temporal.sql @@ -125,8 +125,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/06_fix_annotation_search_by_body.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/06_fix_annotation_search_by_body.sql index d26612ef..b7d43591 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/06_fix_annotation_search_by_body.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/06_fix_annotation_search_by_body.sql @@ -128,8 +128,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/migrations/v002/07_fix_annotation_update.sql b/elucidate-server/src/main/resources/database/sql/migrations/v002/07_fix_annotation_update.sql index 0242544d..8a570856 100644 --- a/elucidate-server/src/main/resources/database/sql/migrations/v002/07_fix_annotation_update.sql +++ b/elucidate-server/src/main/resources/database/sql/migrations/v002/07_fix_annotation_update.sql @@ -58,8 +58,3 @@ $BODY$ END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; - -ALTER FUNCTION public.annotation_update(character varying, character varying, jsonb) OWNER TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO postgres; -GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO annotations_role; -REVOKE ALL ON FUNCTION public.annotation_update(character varying, character varying, jsonb) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/permissions/annotations_permissions.sql b/elucidate-server/src/main/resources/database/sql/permissions/annotations_permissions.sql index 3fae46d1..0cc82387 100644 --- a/elucidate-server/src/main/resources/database/sql/permissions/annotations_permissions.sql +++ b/elucidate-server/src/main/resources/database/sql/permissions/annotations_permissions.sql @@ -11,3 +11,75 @@ GRANT ALL ON SEQUENCE annotation_history_id_seq TO annotations_role; GRANT ALL ON SEQUENCE annotation_selector_id_seq TO annotations_role; GRANT ALL ON SEQUENCE annotation_target_id_seq TO annotations_role; GRANT ALL ON SEQUENCE annotation_temporal_id_seq TO annotations_role; + +GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_target_delete(integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_generator_delete(integer, integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_history_delete(integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_history_create(integer, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO annotations_role; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_body TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_type TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_selector TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_email_sha1 TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_collection TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_temporal TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_email TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_history TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_homepage TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_target TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent TO annotations_role; +GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_name TO annotations_role; +GRANT ALL ON TABLE public.annotation_history_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_body_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_css_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_fragment_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_collection_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_xpath_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_generator_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_svg_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_temporal_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_data_position_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_target_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_creator_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_text_quote_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_text_position_selector_get TO annotations_role; +GRANT ALL ON TABLE public.annotation_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/permissions/postgres_permissions.sql b/elucidate-server/src/main/resources/database/sql/permissions/postgres_permissions.sql new file mode 100644 index 00000000..57199ee7 --- /dev/null +++ b/elucidate-server/src/main/resources/database/sql/permissions/postgres_permissions.sql @@ -0,0 +1,142 @@ +ALTER FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO postgres; +ALTER FUNCTION public.annotation_svg_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_delete(character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_target_delete(integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_target_delete(integer) TO postgres; +ALTER FUNCTION public.annotation_generator_delete(integer, integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_generator_delete(integer, integer, integer) TO postgres; +ALTER FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; +ALTER FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) TO postgres; +ALTER FUNCTION public.annotation_text_quote_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_body_delete(integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO postgres; +ALTER FUNCTION public.annotation_creator_delete(integer, integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO postgres; +ALTER FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) TO postgres; +ALTER FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO postgres; +ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO postgres; +ALTER FUNCTION public.annotation_text_position_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_history_delete(integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_history_delete(integer) TO postgres; +ALTER FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) TO postgres; +ALTER FUNCTION public.annotation_update(character varying, character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO postgres; +ALTER FUNCTION public.annotation_xpath_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_history_create(integer, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_history_create(integer, jsonb) TO postgres; +ALTER FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) TO postgres; +ALTER FUNCTION public.annotation_css_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_fragment_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_collection_create(character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_data_position_selector_delete(integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) TO postgres; +ALTER FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) TO postgres; +ALTER FUNCTION public.annotation_create(character varying, character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) TO postgres; +ALTER FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; +ALTER FUNCTION public.annotation_temporal_delete(integer, integer, integer) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) TO postgres; +ALTER FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) TO postgres; +ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) TO postgres; +ALTER FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; +ALTER FUNCTION public.annotation_delete(character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_delete(character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_update(character varying, character varying, jsonb) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_update(character varying, character varying, jsonb) TO postgres; +ALTER FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) TO postgres; +ALTER FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) OWNER TO postgres; +GRANT EXECUTE ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) TO postgres; +ALTER TABLE public.annotation_body OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_body TO postgres; +ALTER TABLE public.annotation OWNER TO postgres; +GRANT ALL ON TABLE public.annotation TO postgres; +ALTER TABLE public.annotation_agent_type OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent_type TO postgres; +ALTER TABLE public.annotation_selector OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_selector TO postgres; +ALTER TABLE public.annotation_agent_email_sha1 OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent_email_sha1 TO postgres; +ALTER TABLE public.annotation_collection OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_collection TO postgres; +ALTER TABLE public.annotation_temporal OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_temporal TO postgres; +ALTER TABLE public.annotation_agent_email OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent_email TO postgres; +ALTER TABLE public.annotation_history OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_history TO postgres; +ALTER TABLE public.annotation_agent_homepage OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent_homepage TO postgres; +ALTER TABLE public.annotation_target OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_target TO postgres; +ALTER TABLE public.annotation_agent OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent TO postgres; +ALTER TABLE public.annotation_agent_name OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_agent_name TO postgres; +ALTER TABLE public.annotation_history_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_history_get TO postgres; +ALTER TABLE public.annotation_body_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_body_get TO postgres; +ALTER TABLE public.annotation_css_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_css_selector_get TO postgres; +ALTER TABLE public.annotation_fragment_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_fragment_selector_get TO postgres; +ALTER TABLE public.annotation_collection_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_collection_get TO postgres; +ALTER TABLE public.annotation_xpath_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_xpath_selector_get TO postgres; +ALTER TABLE public.annotation_generator_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_generator_get TO postgres; +ALTER TABLE public.annotation_svg_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_svg_selector_get TO postgres; +ALTER TABLE public.annotation_temporal_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_temporal_get TO postgres; +ALTER TABLE public.annotation_data_position_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_data_position_selector_get TO postgres; +ALTER TABLE public.annotation_target_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_target_get TO postgres; +ALTER TABLE public.annotation_creator_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_creator_get TO postgres; +ALTER TABLE public.annotation_text_quote_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_text_quote_selector_get TO postgres; +ALTER TABLE public.annotation_text_position_selector_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_text_position_selector_get TO postgres; +ALTER TABLE public.annotation_get OWNER TO postgres; +GRANT ALL ON TABLE public.annotation_get TO postgres; diff --git a/elucidate-server/src/main/resources/database/sql/permissions/public_permissions.sql b/elucidate-server/src/main/resources/database/sql/permissions/public_permissions.sql new file mode 100644 index 00000000..36e01cac --- /dev/null +++ b/elucidate-server/src/main/resources/database/sql/permissions/public_permissions.sql @@ -0,0 +1,43 @@ +REVOKE ALL ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_data_position_selector_create(integer, integer, character varying, integer, integer, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_svg_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_delete(character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_target_delete(integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_generator_delete(integer, integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; +REVOKE ALL ON FUNCTION public.annotation_temporal_create(integer, integer, integer, character varying, timestamp without time zone, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_text_quote_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_body_delete(integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_creator_delete(integer, integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_xpath_selector_create(integer, integer, character varying, text, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_text_position_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_history_delete(integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_fragment_selector_create(integer, integer, character varying, text, text, integer, integer, integer, integer, integer, integer, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_update(character varying, character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_creator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) FROM public; +REVOKE ALL ON FUNCTION public.annotation_xpath_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_history_create(integer, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_text_position_selector_create(integer, integer, character varying, integer, integer, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_css_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_fragment_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_collection_create(character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_data_position_selector_delete(integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_svg_selector_create(integer, integer, character varying, text, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_create(character varying, character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_target_create(integer, character varying, character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_generator_create(integer, integer, integer, character varying, jsonb, character varying[], jsonb[], text[], jsonb[], character varying, text[], jsonb[], text[], jsonb[], text[], jsonb[]) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; +REVOKE ALL ON FUNCTION public.annotation_temporal_delete(integer, integer, integer) FROM public; +REVOKE ALL ON FUNCTION public.annotation_text_quote_selector_create(integer, integer, character varying, text, text, text, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_target(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_temporal(boolean, boolean, boolean, character varying[], timestamp without time zone) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_creator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; +REVOKE ALL ON FUNCTION public.annotation_delete(character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_update(character varying, character varying, jsonb) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_body(boolean, boolean, character varying, boolean, integer, integer, integer, integer, integer, integer, character varying, character varying) FROM public; +REVOKE ALL ON FUNCTION public.annotation_search_by_generator(boolean, boolean, boolean, character varying, character varying, boolean) FROM public; diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation.sql index c4aacf8b..d4aa540f 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation.sql @@ -19,9 +19,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation OWNER TO postgres; -GRANT ALL ON TABLE public.annotation TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation TO annotations_role; -- Index: public.idx_annotation_annotationid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent.sql index 04d45859..9156b813 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent.sql @@ -24,9 +24,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent TO annotations_role; -- Index: public.idx_annotation_agent_agentiri diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email.sql index da39c346..6ce5c13d 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email.sql @@ -18,9 +18,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent_email OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent_email TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_email TO annotations_role; -- Index: public.idx_annotation_agent_email_annotationagentid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email_sha1.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email_sha1.sql index 2e486e8f..8a0ca3c0 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email_sha1.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_email_sha1.sql @@ -18,9 +18,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent_email_sha1 OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent_email_sha1 TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_email_sha1 TO annotations_role; -- Index: public.idx_annotation_agent_email_sha1_annotationagentid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_homepage.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_homepage.sql index 11a10be8..0792aad8 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_homepage.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_homepage.sql @@ -18,9 +18,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent_homepage OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent_homepage TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_homepage TO annotations_role; -- Index: public.idx_annotation_agent_homepage_annotationagentid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_name.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_name.sql index e95a3bad..dcce199f 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_name.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_name.sql @@ -18,9 +18,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent_name OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent_name TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_name TO annotations_role; -- Index: public.idx_annotation_agent_name_annotationagentid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_type.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_type.sql index 2c9d9803..68657270 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_type.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_agent_type.sql @@ -18,9 +18,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_agent_type OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_agent_type TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_agent_type TO annotations_role; -- Index: public.idx_annotation_agent_type_annotationagentid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_body.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_body.sql index e238d4a9..d340147f 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_body.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_body.sql @@ -19,9 +19,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_body OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_body TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_body TO annotations_role; -- Index: public.idx_annotation_body_annotationid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_collection.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_collection.sql index b4f2a497..105f4033 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_collection.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_collection.sql @@ -17,9 +17,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_collection OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_collection TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_collection TO annotations_role; -- Index: public.idx_annotation_collection_collectionid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_history.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_history.sql index e145d6df..54c94333 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_history.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_history.sql @@ -18,7 +18,3 @@ CREATE TABLE public.annotation_history WITH ( OIDS = FALSE ); - -ALTER TABLE public.annotation_history OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_history TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_history TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_selector.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_selector.sql index 5e688c49..48e21f65 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_selector.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_selector.sql @@ -33,9 +33,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_selector OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_selector TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_selector TO annotations_role; -- Index: public.idx_annotation_selector_bodyid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_target.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_target.sql index d3240201..7353027f 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_target.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_target.sql @@ -19,9 +19,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_target OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_target TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_target TO annotations_role; -- Index: public.idx_annotation_target_annotationid diff --git a/elucidate-server/src/main/resources/database/sql/tables/annotation_temporal.sql b/elucidate-server/src/main/resources/database/sql/tables/annotation_temporal.sql index 71a4b7ed..12bad1aa 100644 --- a/elucidate-server/src/main/resources/database/sql/tables/annotation_temporal.sql +++ b/elucidate-server/src/main/resources/database/sql/tables/annotation_temporal.sql @@ -23,9 +23,6 @@ WITH ( OIDS=FALSE ); -ALTER TABLE public.annotation_temporal OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_temporal TO postgres; -GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.annotation_temporal TO annotations_role; -- Index: public.idx_annotation_temporal_annotationid diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_body_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_body_get.sql index 520007b4..97d5b9ac 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_body_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_body_get.sql @@ -17,7 +17,3 @@ CREATE OR REPLACE VIEW public.annotation_body_get AS annotation_body ab LEFT JOIN annotation a ON ab.annotationid = a.id LEFT JOIN annotation_collection ac ON a.collectionid = ac.id; - -ALTER TABLE public.annotation_body_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_body_get TO postgres; -GRANT ALL ON TABLE public.annotation_body_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_collection_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_collection_get.sql index fff18136..27c5d3f4 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_collection_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_collection_get.sql @@ -13,7 +13,3 @@ CREATE OR REPLACE VIEW public.annotation_collection_get AS ac.id FROM annotation_collection ac; - -ALTER TABLE public.annotation_collection_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_collection_get TO postgres; -GRANT ALL ON TABLE public.annotation_collection_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_creator_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_creator_get.sql index 3cbf4f7c..c970df0a 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_creator_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_creator_get.sql @@ -40,7 +40,3 @@ CREATE OR REPLACE VIEW public.annotation_creator_get AS LEFT JOIN annotation_collection ac ON ac.id = a.collectionid WHERE aa.relationshiptype = 'CREATOR'; - -ALTER TABLE public.annotation_creator_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_creator_get TO postgres; -GRANT ALL ON TABLE public.annotation_creator_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_css_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_css_selector_get.sql index 178b4653..c5adec8a 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_css_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_css_selector_get.sql @@ -25,7 +25,3 @@ CREATE OR REPLACE VIEW public.annotation_css_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#CssSelector'; - -ALTER TABLE public.annotation_css_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_css_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_css_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_data_position_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_data_position_selector_get.sql index 8f9b5cc3..296776d0 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_data_position_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_data_position_selector_get.sql @@ -26,7 +26,3 @@ CREATE OR REPLACE VIEW public.annotation_data_position_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#DataPositionSelector'; - -ALTER TABLE public.annotation_data_position_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_data_position_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_data_position_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_fragment_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_fragment_selector_get.sql index 5bca44ac..6adeed12 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_fragment_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_fragment_selector_get.sql @@ -31,7 +31,3 @@ CREATE OR REPLACE VIEW public.annotation_fragment_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#FragmentSelector'; - -ALTER TABLE public.annotation_fragment_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_fragment_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_fragment_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_generator_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_generator_get.sql index 306208b2..f05c5b7b 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_generator_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_generator_get.sql @@ -40,7 +40,3 @@ CREATE OR REPLACE VIEW public.annotation_generator_get AS LEFT JOIN annotation_collection ac ON ac.id = a.collectionid WHERE aa.relationshiptype = 'GENERATOR'; - -ALTER TABLE public.annotation_generator_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_generator_get TO postgres; -GRANT ALL ON TABLE public.annotation_generator_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_get.sql index 6f291f24..24eb1e1e 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_get.sql @@ -15,7 +15,3 @@ CREATE OR REPLACE VIEW public.annotation_get AS FROM annotation a LEFT JOIN annotation_collection ac ON a.collectionid = ac.id; - -ALTER TABLE public.annotation_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_get TO postgres; -GRANT ALL ON TABLE public.annotation_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_history_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_history_get.sql index dee59fe7..389da059 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_history_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_history_get.sql @@ -16,7 +16,3 @@ CREATE OR REPLACE VIEW public.annotation_history_get AS annotation_history ah LEFT JOIN annotation a ON ah.annotationid = a.id LEFT JOIN annotation_collection ac ON a.collectionid = ac.id; - -ALTER TABLE public.annotation_history_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_history_get TO postgres; -GRANT ALL ON TABLE public.annotation_history_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_svg_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_svg_selector_get.sql index 3ef246a9..52dc86c9 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_svg_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_svg_selector_get.sql @@ -25,7 +25,3 @@ CREATE OR REPLACE VIEW public.annotation_svg_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#SvgSelector'; - -ALTER TABLE public.annotation_svg_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_svg_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_svg_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_target_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_target_get.sql index d45a1bbf..3b3b6488 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_target_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_target_get.sql @@ -17,7 +17,3 @@ CREATE OR REPLACE VIEW public.annotation_target_get AS annotation_target at LEFT JOIN annotation a ON at.annotationid = a.id LEFT JOIN annotation_collection ac ON a.collectionid = ac.id; - -ALTER TABLE public.annotation_target_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_target_get TO postgres; -GRANT ALL ON TABLE public.annotation_target_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_temporal_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_temporal_get.sql index 4af61e77..ec000562 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_temporal_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_temporal_get.sql @@ -23,7 +23,3 @@ CREATE OR REPLACE VIEW public.annotation_temporal_get AS LEFT JOIN annotation_target at ON at.id = atp.targetid LEFT JOIN annotation a ON a.id = atp.annotationid LEFT JOIN annotation_collection ac ON ac.id = a.collectionid; - -ALTER TABLE public.annotation_temporal_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_temporal_get TO postgres; -GRANT ALL ON TABLE public.annotation_temporal_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_text_position_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_text_position_selector_get.sql index 7cb56a95..91e49ab7 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_text_position_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_text_position_selector_get.sql @@ -26,7 +26,3 @@ CREATE OR REPLACE VIEW public.annotation_text_position_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#TextPositionSelector'; - -ALTER TABLE public.annotation_text_position_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_text_position_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_text_position_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_text_quote_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_text_quote_selector_get.sql index d1718253..086394d0 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_text_quote_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_text_quote_selector_get.sql @@ -27,7 +27,3 @@ CREATE OR REPLACE VIEW public.annotation_text_quote_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#TextQuoteSelector'; - -ALTER TABLE public.annotation_text_quote_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_text_quote_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_text_quote_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/database/sql/views/annotation_xpath_selector_get.sql b/elucidate-server/src/main/resources/database/sql/views/annotation_xpath_selector_get.sql index bbd28975..aa412fa4 100644 --- a/elucidate-server/src/main/resources/database/sql/views/annotation_xpath_selector_get.sql +++ b/elucidate-server/src/main/resources/database/sql/views/annotation_xpath_selector_get.sql @@ -25,7 +25,3 @@ CREATE OR REPLACE VIEW public.annotation_xpath_selector_get AS LEFT JOIN annotation_collection ac ON a.collectionid = ac.id WHERE asl.type = 'http://www.w3.org/ns/oa#XPathSelector'; - -ALTER TABLE public.annotation_xpath_selector_get OWNER TO postgres; -GRANT ALL ON TABLE public.annotation_xpath_selector_get TO postgres; -GRANT ALL ON TABLE public.annotation_xpath_selector_get TO annotations_role; diff --git a/elucidate-server/src/main/resources/eludicate-server.properties b/elucidate-server/src/main/resources/eludicate-server.properties index a61a0905..611bf23f 100644 --- a/elucidate-server/src/main/resources/eludicate-server.properties +++ b/elucidate-server/src/main/resources/eludicate-server.properties @@ -87,6 +87,7 @@ db.pool.connectionHealthQuery=select 1 db.pool.acquireRetryAttempts=5 db.pool.acquireRetryDelay=2000 +liquibase.contexts=!dlcs-permissions ##################################################### ################# Listener Settings #################