jl141 commented on issue #13345:
URL: https://github.com/apache/superset/issues/13345#issuecomment-3398461784
@michael-s-molina Thanks for the reply! We've looked into the items you
brought up and have modified our approach:
- When an admin deletes a user, we will require them to choose a user to
reassign assets (dashboards, charts, saved queries) to, given that there exists
associated data.
- Regarding other data, we will either set the delete rule on `ab_user.id`
to be `CASCADE` or `SET NULL`, depending on whether they are saved in the
tables as `user_id` or `changed/created/last_saved_by_fk`. e.g. `CASCADE` on
tables `ab_user_role`, `favstar`, `query`, `sql_metrics`, etc. and `SET NULL`
on tables `ab_user`, `annotation`, `annotation_layer`, `dbs`, etc.
- Regarding log data integrity in the context of deleting a user: The logs
table contains references to user IDs that seemingly cannot be broken. Thus in
the case of the hard deleting a user, we are unsure how to achieve this
selective deletion.
- One option is to `CASCADE` delete the logs along with the user, but this
is not ideal if the logs are needed for later reference or legal purposes.
- Another option is to soft delete the user instead by keeping the deleted
user in the `ab_user` table, and changing its username from “X” to
“[DELETED]_X”, which would keep the logs intact while allowing the username “X”
to be reused. However, this would also mean that the other data (as in the
bullet above) would neither be deleted nor set null, and we may run into the
aforementioned problem of substantial logic changes.
- An additional option (utilizing `SET NULL` delete rule on `ab_user.id`)
is to add a column `user_info` to the logs table that provides information
about the user (e.g. username + email) and logic to access this information
when it turns out that `user_id` is null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]