Skip to content

Commit dfbc73b

Browse files
committed
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)
1 parent 231cb8c commit dfbc73b

77 files changed

Lines changed: 356 additions & 519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

elucidate-server/src/main/java/com/digirati/elucidate/infrastructure/config/RepositoryConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public SpringLiquibase liquibaseMigrations() throws PropertyVetoException {
3131
SpringLiquibase liquibase = new SpringLiquibase();
3232
liquibase.setDataSource(dataSource());
3333
liquibase.setChangeLog("classpath:database/liquibase-changelog.xml");
34+
liquibase.setContexts(environment.getRequiredProperty("liquibase.contexts", String.class));
3435

3536
return liquibase;
3637
}

elucidate-server/src/main/resources/database/liquibase-changelog.xml

Lines changed: 97 additions & 204 deletions
Large diffs are not rendered by default.

elucidate-server/src/main/resources/database/sql/functions/annotation_body_create.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,3 @@ $BODY$
4848
END;
4949
$BODY$
5050
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
51-
52-
ALTER FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) OWNER TO postgres;
53-
GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO postgres;
54-
GRANT EXECUTE ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) TO annotations_role;
55-
REVOKE ALL ON FUNCTION public.annotation_body_create(integer, character varying, character varying, jsonb) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_body_delete.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,3 @@ FROM
3636
END;
3737
$BODY$
3838
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
39-
40-
ALTER FUNCTION public.annotation_body_delete(integer) OWNER TO postgres;
41-
GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO postgres;
42-
GRANT EXECUTE ON FUNCTION public.annotation_body_delete(integer) TO annotations_role;
43-
REVOKE ALL ON FUNCTION public.annotation_body_delete(integer) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_collection_create.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,3 @@ $BODY$
4141
END;
4242
$BODY$
4343
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
44-
45-
ALTER FUNCTION public.annotation_collection_create(character varying, jsonb) OWNER TO postgres;
46-
GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO postgres;
47-
GRANT EXECUTE ON FUNCTION public.annotation_collection_create(character varying, jsonb) TO annotations_role;
48-
REVOKE ALL ON FUNCTION public.annotation_collection_create(character varying, jsonb) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_create.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,3 @@ $BODY$
5656
END;
5757
$BODY$
5858
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
59-
60-
ALTER FUNCTION public.annotation_create(character varying, character varying, jsonb) OWNER TO postgres;
61-
GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO postgres;
62-
GRANT EXECUTE ON FUNCTION public.annotation_create(character varying, character varying, jsonb) TO annotations_role;
63-
REVOKE ALL ON FUNCTION public.annotation_create(character varying, character varying, jsonb) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_creator_create.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,3 @@ $BODY$
180180
END;
181181
$BODY$
182182
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
183-
184-
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;
185-
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;
186-
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;
187-
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;

elucidate-server/src/main/resources/database/sql/functions/annotation_creator_delete.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,3 @@ $BODY$
7575
END;
7676
$BODY$
7777
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
78-
79-
ALTER FUNCTION public.annotation_creator_delete(integer, integer, integer) OWNER TO postgres;
80-
GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO postgres;
81-
GRANT EXECUTE ON FUNCTION public.annotation_creator_delete(integer, integer, integer) TO annotations_role;
82-
REVOKE ALL ON FUNCTION public.annotation_creator_delete(integer, integer, integer) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_create.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,3 @@ $BODY$
6060
END;
6161
$BODY$
6262
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
63-
64-
ALTER FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) OWNER TO postgres;
65-
GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO postgres;
66-
GRANT EXECUTE ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) TO annotations_role;
67-
REVOKE ALL ON FUNCTION public.annotation_css_selector_create(integer, integer, character varying, text, jsonb) FROM public;

elucidate-server/src/main/resources/database/sql/functions/annotation_css_selector_delete.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,3 @@ $BODY$
4949
END;
5050
$BODY$
5151
LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000;
52-
53-
ALTER FUNCTION public.annotation_css_selector_delete(integer, integer) OWNER TO postgres;
54-
GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO postgres;
55-
GRANT EXECUTE ON FUNCTION public.annotation_css_selector_delete(integer, integer) TO annotations_role;
56-
REVOKE ALL ON FUNCTION public.annotation_css_selector_delete(integer, integer) FROM public;

0 commit comments

Comments
 (0)