#137 [Rechte-Modul] sample-data für User+UserRoleAssignment
This commit is contained in:
parent
6eaab336c0
commit
01d28a85d4
@ -70,7 +70,7 @@ public enum Role {
|
|||||||
/**
|
/**
|
||||||
* Any user which belongs to a customer has at least this role.
|
* Any user which belongs to a customer has at least this role.
|
||||||
*/
|
*/
|
||||||
ACTUAL_CUSTOMER_USER(80),
|
ACTUAL_CUSTOMER_USER(30),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this to grant rights to any user, also special function users who have no
|
* Use this to grant rights to any user, also special function users who have no
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||||
|
|
||||||
<!-- JHipster generated entity table changesets -->
|
<!-- initial JHipster tables (user etc.) -->
|
||||||
<include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
|
||||||
|
|
||||||
|
<!-- sample data. comes after historicization triggers, historicization applies -->
|
||||||
|
<include file="config/liquibase/sample-data/users.xml" relativeToChangelogFile="false"/>
|
||||||
|
<include file="config/liquibase/sample-data/users_authorities.xml" relativeToChangelogFile="false"/>
|
||||||
|
|
||||||
|
<!-- JHipster generated entity table changesets -->
|
||||||
<include file="config/liquibase/changelog/20190507105332_added_entity_Customer.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20190507105332_added_entity_Customer.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/changelog/20190507105333_added_entity_Membership.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20190507105333_added_entity_Membership.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/changelog/20190507105334_added_entity_Share.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20190507105334_added_entity_Share.xml" relativeToChangelogFile="false"/>
|
||||||
@ -22,7 +28,7 @@
|
|||||||
<include file="config/liquibase/changelog/20190507105342_added_entity_constraints_UserRoleAssignment.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20190507105342_added_entity_constraints_UserRoleAssignment.xml" relativeToChangelogFile="false"/>
|
||||||
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
||||||
|
|
||||||
<!-- additional changesets, not generated by JHipster -->
|
<!-- additional constraint changesets, not generated by JHipster -->
|
||||||
<include file="config/liquibase/changelog/constraints_UserRoleAssignment.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/constraints_UserRoleAssignment.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/changelog/constraints_Membership.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/constraints_Membership.xml" relativeToChangelogFile="false"/>
|
||||||
|
|
||||||
@ -35,8 +41,8 @@
|
|||||||
<include file="config/liquibase/historicization/historicization_Share.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/historicization/historicization_Share.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/historicization/historicization_Asset.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/historicization/historicization_Asset.xml" relativeToChangelogFile="false"/>
|
||||||
|
|
||||||
<!-- sample data. comes after histo
|
<!-- sample data. comes after historicization triggers, historicization applies -->
|
||||||
ricization triggers, historicization applies -->
|
<include file="config/liquibase/sample-data/user_role_assignments.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/sample-data/customers.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/sample-data/customers.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/sample-data/memberships.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/sample-data/memberships.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/sample-data/shares.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/sample-data/shares.xml" relativeToChangelogFile="false"/>
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
id;user_id;entity_type_id;entity_object_id;assigned_role
|
||||||
|
1001;111;customer.Customer;1;CONTRACTUAL_CONTACT
|
||||||
|
1002;112;customer.Customer;2;CONTRACTUAL_CONTACT
|
||||||
|
1003;113;customer.Customer;3;CONTRACTUAL_CONTACT
|
||||||
|
1004;114;customer.Customer;4;CONTRACTUAL_CONTACT
|
||||||
|
1005;115;customer.Customer;5;CONTRACTUAL_CONTACT
|
||||||
|
1006;116;customer.Customer;6;CONTRACTUAL_CONTACT
|
||||||
|
1007;120;customer.Customer;1;FINANCIAL_CONTACT
|
||||||
|
1008;121;customer.Customer;1;TECHNICAL_CONTACT
|
||||||
|
1009;122;customer.Customer;2;FINANCIAL_CONTACT
|
||||||
|
1010;123;customer.Customer;2;TECHNICAL_CONTACT
|
||||||
|
1011;124;customer.Customer;3;FINANCIAL_CONTACT
|
||||||
|
1012;125;customer.Customer;3;TECHNICAL_CONTACT
|
||||||
|
1013;126;customer.Customer;4;FINANCIAL_CONTACT
|
||||||
|
1014;127;customer.Customer;4;TECHNICAL_CONTACT
|
||||||
|
1015;128;customer.Customer;5;FINANCIAL_CONTACT
|
||||||
|
1016;129;customer.Customer;5;TECHNICAL_CONTACT
|
|
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||||
|
|
||||||
|
<changeSet id="20190508133600-1" author="mhoennig" context="sample-data">
|
||||||
|
<loadData encoding="UTF-8"
|
||||||
|
file="config/liquibase/sample-data/user_role_assignments.csv"
|
||||||
|
separator=";"
|
||||||
|
tableName="user_role_assignment">
|
||||||
|
</loadData>
|
||||||
|
|
||||||
|
<rollback>
|
||||||
|
DELETE FROM user_role_assignment WHERE id >=100 AND id < 1000000;
|
||||||
|
</rollback>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
24
src/main/resources/config/liquibase/sample-data/users.csv
Normal file
24
src/main/resources/config/liquibase/sample-data/users.csv
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
id;login;password_hash;first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by
|
||||||
|
101;test-supporter-a;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;A;Test Supporter;ts-a@example.com;;true;de;system;system
|
||||||
|
102;test-supporter-b;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;B;Test Supporter;ts-b@example.com;;true;de;system;system
|
||||||
|
103;test-supporter-c;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;C;Test Supporter;ts-c@example.com;;true;de;system;system
|
||||||
|
104;test-admin-a;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;A;Test Admin;ta-a@example.com;;true;de;system;system
|
||||||
|
105;test-admin-b;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;B;Test Admin;ta-b@example.com;;true;de;system;system
|
||||||
|
106;test-hostmaster-a;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;A;Test Hostmaster;th-a@example.com;;true;de;system;system
|
||||||
|
107;test-hostmaster-b;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;B;Test Hostmaster;th-b@example.com;;true;de;system;system
|
||||||
|
111;aaa-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Anton;AAA Testuser;aaa@example.com;;true;de;system;system
|
||||||
|
112;bbb-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Berta;BBB Testuser;bbb@example.com;;true;de;system;system
|
||||||
|
113;ccc-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Cecilie;CCC Testuser;ccc@example.com;;true;de;system;system
|
||||||
|
114;ddd-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Dieter;DDD Testuser;ddd@example.com;;true;de;system;system
|
||||||
|
115;abc-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Alva;ABC Testuser;abc@example.com;;true;de;system;system
|
||||||
|
116;bca-test;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Bert Cäsar;Adelbert;bca@example.com;;true;de;system;system
|
||||||
|
120;test00;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 00;Test-User;test-user00@localhost;;true;de;system;system
|
||||||
|
121;test01;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 01;Test-User;test-user01@localhost;;true;de;system;system
|
||||||
|
122;test02;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 02;Test-User;test-user02@localhost;;true;de;system;system
|
||||||
|
123;test03;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 03;Test-User;test-user03@localhost;;true;de;system;system
|
||||||
|
124;test04;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 04;Test-User;test-user04@localhost;;true;de;system;system
|
||||||
|
125;test05;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 05;Test-User;test-user05@localhost;;true;de;system;system
|
||||||
|
126;test06;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 06;Test-User;test-user06@localhost;;true;de;system;system
|
||||||
|
127;test07;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 07;Test-User;test-user07@localhost;;true;de;system;system
|
||||||
|
128;test08;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 08;Test-User;test-user08@localhost;;true;de;system;system
|
||||||
|
129;test09;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;Test-User 09;Test-User;test-user09@localhost;;true;de;system;system
|
|
20
src/main/resources/config/liquibase/sample-data/users.xml
Normal file
20
src/main/resources/config/liquibase/sample-data/users.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||||
|
|
||||||
|
<changeSet id="20190508133600-1" author="mhoennig" context="sample-data">
|
||||||
|
<loadData encoding="UTF-8"
|
||||||
|
file="config/liquibase/sample-data/users.csv"
|
||||||
|
separator=";"
|
||||||
|
tableName="JHI_USER">
|
||||||
|
</loadData>
|
||||||
|
|
||||||
|
<rollback>
|
||||||
|
DELETE FROM user WHERE id >=100 AND id < 1000000;
|
||||||
|
</rollback>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
@ -0,0 +1,33 @@
|
|||||||
|
user_id;authority_name
|
||||||
|
101;ROLE_SUPPORTER
|
||||||
|
101;ROLE_USER
|
||||||
|
102;ROLE_SUPPORTER
|
||||||
|
102;ROLE_USER
|
||||||
|
103;ROLE_SUPPORTER
|
||||||
|
103;ROLE_USER
|
||||||
|
104;ROLE_ADMIN
|
||||||
|
104;ROLE_USER
|
||||||
|
105;ROLE_ADMIN
|
||||||
|
105;ROLE_USER
|
||||||
|
106;ROLE_HOSTMASTER
|
||||||
|
106;ROLE_ADMIN
|
||||||
|
106;ROLE_USER
|
||||||
|
107;ROLE_HOSTMASTER
|
||||||
|
107;ROLE_ADMIN
|
||||||
|
107;ROLE_USER
|
||||||
|
111;ROLE_USER
|
||||||
|
112;ROLE_USER
|
||||||
|
113;ROLE_USER
|
||||||
|
114;ROLE_USER
|
||||||
|
115;ROLE_USER
|
||||||
|
116;ROLE_USER
|
||||||
|
120;ROLE_USER
|
||||||
|
121;ROLE_USER
|
||||||
|
122;ROLE_USER
|
||||||
|
123;ROLE_USER
|
||||||
|
124;ROLE_USER
|
||||||
|
125;ROLE_USER
|
||||||
|
126;ROLE_USER
|
||||||
|
127;ROLE_USER
|
||||||
|
128;ROLE_USER
|
||||||
|
129;ROLE_USER
|
|
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||||
|
|
||||||
|
<changeSet id="20190508133600-1" author="mhoennig" context="sample-data">
|
||||||
|
<loadData encoding="UTF-8"
|
||||||
|
file="config/liquibase/sample-data/users_authorities.csv"
|
||||||
|
separator=";"
|
||||||
|
tableName="JHI_USER_AUTHORITY">
|
||||||
|
</loadData>
|
||||||
|
|
||||||
|
<rollback>
|
||||||
|
DELETE FROM JHI_USER_AUTHORITY WHERE id >=100 AND id < 1000000;
|
||||||
|
</rollback>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
Loading…
Reference in New Issue
Block a user