One admin can't revoke another admin

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 Like

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 Likes

I have removed myself from DISCOURSE_DEVELOPER_EMAILS, then the UI did not provide “Revoke admin” for myself. I find this problematic that an admin cannot step down.

So I went to the console and ran in the rails console:

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

Is this correct?

I found that I could still post in the Staff category. So I added:

u.revoke_admin!

And now I’m a normal user. :partying_face:

1 Like

Yes, it’s not possible to demote yourself. You’d either need to do it from the console, or ask one of the other site admins to do it through the UI as normal.

As long as you’re not in the DISCOURSE_DEVELOPER_EMAILS anymore you shouldn’t be re-promoted when you log out/login.

1 Like