# 删除具有管理员权限的系统账户而没有撤销按钮

**URL:** https://meta.discourse.org/t/delete-system-account-with-admin-right-without-revoke-button/323604
**Category:** Support
**Created:** [2024年八月27日 16:37 UTC](https://meta.discourse.org/t/delete-system-account-with-admin-right-without-revoke-button/323604 "2024-08-27T16:37:30Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ondrej](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrej/32/198804_2.png) [@ondrej](https://meta.discourse.org/u/ondrej)
#### Post date: [2024年八月27日 19:38 UTC](https://meta.discourse.org/t/delete-system-account-with-admin-right-without-revoke-button/323604/2 "2024-08-27T19:38:55Z")

</div>

我做了一些搜索。我认为只要你有访问权限，这个方法就行。

> [@Deleting Users in rails console](https://meta.discourse.org/t/deleting-users-in-rails-console/141540/11?u=ondrej):
>
> Correct. Staff users cannot be deleted. To delete the user, you’d first have to remove their admin access. u = User.find\_by\_username\_or\_email("ex@example.com") u.admin = false u.moderator = false u.save UserDestroyer.new(Discourse.system\_user).destroy(u, delete\_posts: false)

---

_[View the full topic](https://meta.discourse.org/t/delete-system-account-with-admin-right-without-revoke-button/323604)._
