feat(gdpr) deactivate users + Store last cnx timestamp #2136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two GDPR related features in this PR:
Description
Deactivate users:
New user status to prevent users from logging in (or using existing tokens) without removing the account altogether.
This is handy to block account left unused for a long time, or block users (for ex. because they left the company) while keeping decision history as it is.
If user is logged in wile being deactivated, s·he is not kicked out
Store the "last connection date" for each user as a timestamp in the database
This is necessary to detect accounts left unused for some time. As simple SQL script can then list all users who have not connected for 6 months for example.
Future features
Changes
users
database tableHow to test
Create user
test_a
No
last_connection
is stored, default status isactive
Generate a token and test REST API access:
Log in with user
test_a
Its
last_connection
is updatedLog out and back in with
fossy
The
last_connection
is updatedDeactivate user
Database is updated:
Check user cannot log back in & use token