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 #608

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beastafk
Copy link

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

It's very common for first time users to accidentally delete their own admin user and then find themselves in situation which is hard 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

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.

1 participant