一个管理员无法撤销另一个管理员

I have 2 admin accounts. Here is what I did. I logged in as a 1st admin, revoked the admin rights of the 2nd admin. Status changed to “Admin? No”. Then I logged in with this 2nd account in ‘incognito’ mode. Admin status changed back himself. What may be a reason for this? Thank you!

1 个赞

There is an admin email address in your config file (app.yml)

The setting is called

DISCOURSE_DEVELOPER_EMAILS:

That admin with that specific email address, will always have admin rights even if others try to remove it.

5 个赞

我已经从 DISCOURSE_DEVELOPER_EMAILS 中移除了自己,然后 UI 没有为我提供“撤销管理员”选项。我认为管理员无法自行卸任是一个问题。

所以我进入了控制台并在 rails 控制台中运行了:

u = User.find(1)
u.admin = false
u.save

这样做正确吗?

1 个赞

是的,无法自行降级。您需要从控制台执行此操作,或者请另一位网站管理员像平常一样通过用户界面执行此操作。

只要您不再 DISCOURSE_DEVELOPER_EMAILS 中,您在注销/登录时就不应被重新提升。

1 个赞