userli
userli copied to clipboard
Replace soft-deletion with list of used addresses?
At the moment, we use a soft-deletion feature for users and aliases: instead of removing them from the database at deletion, we mark them as deleted. This is required in order to prevent impersonation (i.e. re-registration of a formerly used address).
A simpler solution would be to create a new entity UsedAddresses
and put deleted aliases and user addresses in there.
Advantages:
- Get rid of the soft-deletion logic for entities
User
andAlias
- Get rid of any metadata for deleted objects. No need to clean deleted objects, just remove them
Possible disadvantages:
- No longer possible to use remaining metadata of deleted objects (
creationTime
,updateTime
and Vouchers)
I now understand why this makes sense. Our current approach produces side-effects like #61. User
and Alias
use different logic to implement the soft-deleted state.
Couldn't we re-use ReservedName
? Conceptually, they are the same thing. It's just a name that is not allowed for users to register again. I think it would make sense to append the name to this list.
To enable this, we would need to make sure that ReservedName
can be domain-specific, which makes sense anyway.
Wenn wir softdeletion behalten wollen, wäre das vllt ein besserer weg als es selber zu implementieren: https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/softdeleteable.md