Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-1043 | Implement soft delete on user and usergroup #1439

Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f78fef0
feature(OP-1043): Implement soft delete on users and usergroups
Oct 25, 2024
660014d
chore: Update user and usergroup operations
Oct 25, 2024
57c3d66
fix: Fix step_a111 script
Oct 25, 2024
04d51ad
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
Oct 25, 2024
88a0467
fix: Fix tests and remove unecessary junit dependency
Oct 25, 2024
e91fdd5
chore: Update license header
Oct 28, 2024
8aecc64
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
Oct 28, 2024
b0505ae
fix: Ensure user/usergroup not deleted before updates
Oct 28, 2024
c91fcb5
fix: Fix user/usergroup tests
Oct 28, 2024
e1546db
fix: Fix group permission tests
Oct 28, 2024
f68a410
chore: Algin with develop
Oct 29, 2024
e0e9af0
chore: Remove redundant initialization and unecessary exception throw
Oct 30, 2024
1d8090f
update: Update Menu operations
Oct 30, 2024
e4b4a7b
update: Hard delete user/usergroup when not used
Oct 31, 2024
c5b9d6d
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
mwithi Oct 31, 2024
ffa11c9
fix: Fix tests
Nov 1, 2024
dfdd6b6
Merge branch 'feature/OP-1043-users-and-groups-soft-delete' of https:…
Nov 1, 2024
823a2c8
chore: Refactor delete user method
Nov 1, 2024
ff558f4
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
mwithi Nov 4, 2024
8a33f68
update: Add btnlaboratorynew and btnlaboratoryedit to laboratorist gr…
Nov 4, 2024
7894952
update: Update user and group update methods
Nov 5, 2024
12ca092
chore: Reformat code and update user repository
Nov 5, 2024
dc324ad
fix: Fix tests
Nov 5, 2024
a624295
chore: Refactor user/group update/delete methods to return entities
Nov 5, 2024
fde896a
chore: Make updatePassword return updated user
Nov 5, 2024
8f7631f
chore: Make updateUserGroup return the updated user group
Nov 5, 2024
a593158
chore: Restore delete methods
Nov 5, 2024
d3979dc
fix: Fix user and user group update
Nov 6, 2024
4b5f275
chore: Add user/user group soft delete tests
Nov 6, 2024
074053e
chore: Refactor code
Nov 6, 2024
8cd700e
fix: Fix tests
Nov 6, 2024
c447172
fix: Apply minor fixes
Nov 7, 2024
57bcccc
fix: Remove unnecessary check in user delete method
Nov 7, 2024
4948f61
chore: Update user browsing manager methods
Nov 7, 2024
ed0988d
fix: Remove unnecessary code
Nov 7, 2024
5652e10
fix: Fix translations
Nov 8, 2024
5a75287
fix: Fix user update methods
Nov 8, 2024
adc18bb
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
Nov 8, 2024
a466010
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
Nov 11, 2024
70ff256
fix: Fix user / usergroup delete/soft delete
Nov 12, 2024
47dcceb
update: Update laboratorist group permissions
Nov 13, 2024
9ada458
chore: Rename withTrashed to withSoftDeletion
Nov 14, 2024
9095529
Merge branch 'develop' into feature/OP-1043-users-and-groups-soft-delete
Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
18 changes: 10 additions & 8 deletions sql/load_demo_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,8 @@ INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `
INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `GM_CREATED_BY`, `GM_CREATED_DATE`, `GM_LAST_MODIFIED_BY`, `GM_LAST_MODIFIED_DATE`) VALUES (344,'admin','btnmedicalswarddelete',1,NULL,NULL,NULL,NULL);
INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `GM_CREATED_BY`, `GM_CREATED_DATE`, `GM_LAST_MODIFIED_BY`, `GM_LAST_MODIFIED_DATE`) VALUES (345,'admin','inventory',1,NULL,NULL,NULL,NULL);
INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `GM_CREATED_BY`, `GM_CREATED_DATE`, `GM_LAST_MODIFIED_BY`, `GM_LAST_MODIFIED_DATE`) VALUES (346,'admin','inventoryward',1,NULL,NULL,NULL,NULL);
INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `GM_CREATED_BY`, `GM_CREATED_DATE`, `GM_LAST_MODIFIED_BY`, `GM_LAST_MODIFIED_DATE`) VALUES (347,'laboratorist','btnlaboratorynew',1,NULL,NULL,NULL,NULL);
INSERT INTO `oh_groupmenu` (`GM_ID`, `GM_UG_ID_A`, `GM_MNI_ID_A`, `GM_ACTIVE`, `GM_CREATED_BY`, `GM_CREATED_DATE`, `GM_LAST_MODIFIED_BY`, `GM_LAST_MODIFIED_DATE`) VALUES (348,'laboratorist','btnlaboratoryedit',1,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `oh_groupmenu` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down Expand Up @@ -6701,10 +6703,10 @@ UNLOCK TABLES;

LOCK TABLES `oh_user` WRITE;
/*!40000 ALTER TABLE `oh_user` DISABLE KEYS */;
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`) VALUES ('admin','admin','$2a$10$FI/PMO0oSHHosF2PX8l3QuB0DJepVfnynbLZ9Zm2711bF2ch8db2S','administrator',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`) VALUES ('doctor','doctor','$2a$04$iqB3DZzyvQos4wCQrSHKyuf/Spr8LyOFF23dihNbS1AWpkIPu..MG','doctor',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`) VALUES ('guest','guest','$2a$10$b0WlANdaNV7Ukn/klFGt3.euZ7PaHuJI6TtBSM2vdxkavvkUDbpo2','guest',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`) VALUES ('laboratorist','laboratorist','$2a$04$mhtLe0xVdhYcUqav2glGXeGULLErkgv8KHMQ1yYLh3TTYnE.V1qOO','laboratorist',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`, `US_DELETED`) VALUES ('admin','admin','$2a$10$FI/PMO0oSHHosF2PX8l3QuB0DJepVfnynbLZ9Zm2711bF2ch8db2S','administrator',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL, false);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`, `US_DELETED`) VALUES ('doctor','doctor','$2a$04$iqB3DZzyvQos4wCQrSHKyuf/Spr8LyOFF23dihNbS1AWpkIPu..MG','doctor',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL, false);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`, `US_DELETED`) VALUES ('guest','guest','$2a$10$b0WlANdaNV7Ukn/klFGt3.euZ7PaHuJI6TtBSM2vdxkavvkUDbpo2','guest',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL, false);
INSERT INTO `oh_user` (`US_ID_A`, `US_UG_ID_A`, `US_PASSWD`, `US_DESC`, `US_CREATED_BY`, `US_CREATED_DATE`, `US_LAST_MODIFIED_BY`, `US_LAST_MODIFIED_DATE`, `US_ACTIVE`, `US_FAILED_ATTEMPTS`, `US_ACCOUNT_LOCKED`, `US_LOCK_TIME`, `US_LAST_LOGIN`, `US_DELETED`) VALUES ('laboratorist','laboratorist','$2a$04$mhtLe0xVdhYcUqav2glGXeGULLErkgv8KHMQ1yYLh3TTYnE.V1qOO','laboratorist',NULL,NULL,NULL,NULL,1,0,0,NULL,NULL, false);
/*!40000 ALTER TABLE `oh_user` ENABLE KEYS */;
UNLOCK TABLES;

Expand All @@ -6727,10 +6729,10 @@ UNLOCK TABLES;

LOCK TABLES `oh_usergroup` WRITE;
/*!40000 ALTER TABLE `oh_usergroup` DISABLE KEYS */;
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`) VALUES ('admin','USER with all the privileges',NULL,NULL,NULL,NULL,1);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`) VALUES ('doctor','Access everywhere except the laboratory',NULL,NULL,NULL,NULL,1);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`) VALUES ('guest','Read Only Users',NULL,NULL,NULL,NULL,1);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`) VALUES ('laboratorist','Access only laboratory',NULL,NULL,NULL,NULL,1);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`, `UG_DELETED`) VALUES ('admin','USER with all the privileges',NULL,NULL,NULL,NULL,1, false);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`, `UG_DELETED`) VALUES ('doctor','Access everywhere except the laboratory',NULL,NULL,NULL,NULL,1, false);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`, `UG_DELETED`) VALUES ('guest','Read Only Users',NULL,NULL,NULL,NULL,1, false);
INSERT INTO `oh_usergroup` (`UG_ID_A`, `UG_DESC`, `UG_CREATED_BY`, `UG_CREATED_DATE`, `UG_LAST_MODIFIED_BY`, `UG_LAST_MODIFIED_DATE`, `UG_ACTIVE`, `UG_DELETED`) VALUES ('laboratorist','Access only laboratory',NULL,NULL,NULL,NULL,1, false);
/*!40000 ALTER TABLE `oh_usergroup` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
1 change: 1 addition & 0 deletions sql/step_04_all_following_steps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ source step_a108_audit_dicom_type_and_dicom_data.sql;
source step_a109_update_user_settings_table_constraints_and_add_usergroups_permissions.sql;
source step_a110_update_operations_table_change_ope_for_to_enum.sql;
source step_a111_add_missing_lock_columns.sql;
source step_a112_users_and_groups_soft_deletion.sql;
5 changes: 5 additions & 0 deletions sql/step_a112_users_and_groups_soft_deletion.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE OH_USER
ADD US_DELETED BOOLEAN DEFAULT false;

ALTER TABLE OH_USERGROUP
ADD UG_DELETED BOOLEAN DEFAULT false;
Loading