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!
סיכום מבוסס בינה מלאכותית
The discussion centers around the inability for one admin to revoke another admin’s rights in Discourse. Ed_Bobkov discovered that after revoking admin status, the affected admin could regain it simply by logging back in. The root cause, identified by IAmGav, is the DISCOURSE_DEVELOPER_EMAILS setting in app.yml, which grants permanent admin rights to any email address listed there. … hellekin found a workaround using the Rails console to manually set u.admin = false and u.revoke_admin!, but noted continued access to the Staff category required further console commands. JammyDodger confirmed that self-demotion through the UI is impossible, requiring either console access or assistance from another admin, and emphasized that removing oneself from DISCOURSE_DEVELOPER_EMAILS prevents automatic re-promotion.
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.
הסרתי את עצמי מ-DISCOURSE_DEVELOPER_EMAILS, ואז הממשק לא סיפק את האפשרות “לבטל הרשאת מנהל” עבורי. אני מוצא את זה בעייתי שאדמין לא יכול לוותר על תפקידו.
אז הלכתי לקונסול והפעלתי בקונסול של Rails:
u = User.find(1)
u.admin = false
u.save
האם זה נכון?
כן, לא ניתן להוריד את עצמך. תצטרך לעשות זאת מהקונסול, או לבקש מאחד ממנהלי האתר האחרים לעשות זאת דרך הממשק כרגיל. כל עוד אינך עוד ב-DISCOURSE_DEVELOPER_EMAILS אתה לא אמור להיות מקודם מחדש כשאתה מתנתק/מתחבר.