#137 [Rechte-Modul] sample-data für User+UserRoleAssignment

This commit is contained in:
Michael Hoennig 2019-05-08 20:17:28 +02:00
parent 6eaab336c0
commit 01d28a85d4
8 changed files with 145 additions and 5 deletions

View File

@ -70,7 +70,7 @@ public enum 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

View File

@ -4,8 +4,14 @@
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">
<!-- JHipster generated entity table changesets -->
<!-- initial JHipster tables (user etc.) -->
<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/20190507105333_added_entity_Membership.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"/>
<!-- 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_Membership.xml" relativeToChangelogFile="false"/>
@ -35,8 +41,8 @@
<include file="config/liquibase/historicization/historicization_Share.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/historicization/historicization_Asset.xml" relativeToChangelogFile="false"/>
<!-- sample data. comes after histo
ricization triggers, historicization applies -->
<!-- sample data. comes after historicization 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/memberships.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/sample-data/shares.xml" relativeToChangelogFile="false"/>

View File

@ -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
1 id user_id entity_type_id entity_object_id assigned_role
2 1001 111 customer.Customer 1 CONTRACTUAL_CONTACT
3 1002 112 customer.Customer 2 CONTRACTUAL_CONTACT
4 1003 113 customer.Customer 3 CONTRACTUAL_CONTACT
5 1004 114 customer.Customer 4 CONTRACTUAL_CONTACT
6 1005 115 customer.Customer 5 CONTRACTUAL_CONTACT
7 1006 116 customer.Customer 6 CONTRACTUAL_CONTACT
8 1007 120 customer.Customer 1 FINANCIAL_CONTACT
9 1008 121 customer.Customer 1 TECHNICAL_CONTACT
10 1009 122 customer.Customer 2 FINANCIAL_CONTACT
11 1010 123 customer.Customer 2 TECHNICAL_CONTACT
12 1011 124 customer.Customer 3 FINANCIAL_CONTACT
13 1012 125 customer.Customer 3 TECHNICAL_CONTACT
14 1013 126 customer.Customer 4 FINANCIAL_CONTACT
15 1014 127 customer.Customer 4 TECHNICAL_CONTACT
16 1015 128 customer.Customer 5 FINANCIAL_CONTACT
17 1016 129 customer.Customer 5 TECHNICAL_CONTACT

View 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/user_role_assignments.csv"
separator=";"
tableName="user_role_assignment">
</loadData>
<rollback>
DELETE FROM user_role_assignment WHERE id >=100 AND id &lt; 1000000;
</rollback>
</changeSet>
</databaseChangeLog>

View 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
1 id login password_hash first_name last_name email image_url activated lang_key created_by last_modified_by
2 101 test-supporter-a $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K A Test Supporter ts-a@example.com true de system system
3 102 test-supporter-b $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K B Test Supporter ts-b@example.com true de system system
4 103 test-supporter-c $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K C Test Supporter ts-c@example.com true de system system
5 104 test-admin-a $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K A Test Admin ta-a@example.com true de system system
6 105 test-admin-b $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K B Test Admin ta-b@example.com true de system system
7 106 test-hostmaster-a $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K A Test Hostmaster th-a@example.com true de system system
8 107 test-hostmaster-b $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K B Test Hostmaster th-b@example.com true de system system
9 111 aaa-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Anton AAA Testuser aaa@example.com true de system system
10 112 bbb-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Berta BBB Testuser bbb@example.com true de system system
11 113 ccc-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Cecilie CCC Testuser ccc@example.com true de system system
12 114 ddd-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Dieter DDD Testuser ddd@example.com true de system system
13 115 abc-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Alva ABC Testuser abc@example.com true de system system
14 116 bca-test $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Bert Cäsar Adelbert bca@example.com true de system system
15 120 test00 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 00 Test-User test-user00@localhost true de system system
16 121 test01 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 01 Test-User test-user01@localhost true de system system
17 122 test02 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 02 Test-User test-user02@localhost true de system system
18 123 test03 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 03 Test-User test-user03@localhost true de system system
19 124 test04 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 04 Test-User test-user04@localhost true de system system
20 125 test05 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 05 Test-User test-user05@localhost true de system system
21 126 test06 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 06 Test-User test-user06@localhost true de system system
22 127 test07 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 07 Test-User test-user07@localhost true de system system
23 128 test08 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 08 Test-User test-user08@localhost true de system system
24 129 test09 $2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K Test-User 09 Test-User test-user09@localhost true de system system

View 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 &lt; 1000000;
</rollback>
</changeSet>
</databaseChangeLog>

View File

@ -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
1 user_id authority_name
2 101 ROLE_SUPPORTER
3 101 ROLE_USER
4 102 ROLE_SUPPORTER
5 102 ROLE_USER
6 103 ROLE_SUPPORTER
7 103 ROLE_USER
8 104 ROLE_ADMIN
9 104 ROLE_USER
10 105 ROLE_ADMIN
11 105 ROLE_USER
12 106 ROLE_HOSTMASTER
13 106 ROLE_ADMIN
14 106 ROLE_USER
15 107 ROLE_HOSTMASTER
16 107 ROLE_ADMIN
17 107 ROLE_USER
18 111 ROLE_USER
19 112 ROLE_USER
20 113 ROLE_USER
21 114 ROLE_USER
22 115 ROLE_USER
23 116 ROLE_USER
24 120 ROLE_USER
25 121 ROLE_USER
26 122 ROLE_USER
27 123 ROLE_USER
28 124 ROLE_USER
29 125 ROLE_USER
30 126 ROLE_USER
31 127 ROLE_USER
32 128 ROLE_USER
33 129 ROLE_USER

View 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_authorities.csv"
separator=";"
tableName="JHI_USER_AUTHORITY">
</loadData>
<rollback>
DELETE FROM JHI_USER_AUTHORITY WHERE id >=100 AND id &lt; 1000000;
</rollback>
</changeSet>
</databaseChangeLog>