-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HAI-1875 Add audit logging for new users and tokens
Add logging for creating permissions, hankekayttaja and hanketunniste. Adding the audit reasonably required some refactoring: - In PermissionService, make the old setPermission function be explicitly for creating new permisisions, so logging can be added. - Move updating the kayttooikeustaso of a permission to PermissionService to centralize modifications and logging. - In HankeKayttajaService, make the saveUser function to handle creating new users explicitly so that logging can be added. - Rename kayttooikeustaso in PermissionEntity to kayttooikeustasoEntity and add a new getter for the actual kayttooikeustaso, so that `permissionEntity.kayttooikeustaso` is required instead of the old `permissionEntity.kayttooikeustaso.kayttooikeustaso`. - Change references to permissionEntity.kayttooikeustasoEntity to use either the new getter for reads or PermissionService functions for modifications where ever possible. - Move creating the permission for a founder inside addHankeFounder, since it seemed like a better packaging and made testing the audit logs easier. - Move the static hasPermission from PermissionService's companion object to PermissionEntity and KayttooikeustasoEntity. - Add userIds to several calls se that the logging can use it. - Move Permission logging to PermissionLoggingService from HankeKayttajaLoggingService. - In tests, use custom asserts to make audit log tests more readable and props to give better error messages when a test fails.
- Loading branch information
Showing
22 changed files
with
859 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
226 changes: 161 additions & 65 deletions
226
...src/integrationTest/kotlin/fi/hel/haitaton/hanke/permissions/HankeKayttajaServiceITest.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.