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

Prevent self user delete #1

Merged
merged 1 commit into from
Aug 31, 2024
Merged

Prevent self user delete #1

merged 1 commit into from
Aug 31, 2024

Conversation

beastafk
Copy link
Contributor

@beastafk beastafk commented Aug 30, 2024

The purpose of this PR is to prevent the synapse admin user from deleting himself.

It's very common for first time users to accidentally delete their own admin user and then find themselves in a situation which is challenging to recover from.

For this to work, a new React component UserPreventSelfDelete is introduced, which accepts a single prop of ownUserIsSelected. If true, it means that the DELETE for this user should be forbidden.

It works on:

  • bulk users' selection - if own user is selected, bulk delete will show an alert and prevent the action
  • delete user media button - inside the User Edit page
  • delete button - on the bottom of the User Edit page
  • the deactivate checkbox is marked as disabled on the User Edit page

@aine-etke aine-etke merged commit 2bb8467 into main Aug 31, 2024
@aine-etke aine-etke deleted the prevent-self-delete branch August 31, 2024 06:33
@aine-etke aine-etke restored the prevent-self-delete branch August 31, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants