A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

Roles based on domain of email account

daegontaven

I want to give anyone with somestaffuser@mydomain.com the sysops role. Is there an easy way to do this?

srishakatux

Is it for MediaWiki? Are you already a Sysop? From a quick search here, it does not seem like it. If you want to be a sysop, you can request the permissions to do so here: https://www.mediawiki.org/wiki/Project:Requests. In any case, here is more on making sysops.

Also, it looks like this is not a developer question, it might fit probably in one of the venues listed on https://www.mediawiki.org/wiki/Project:Support_desk.

daegontaven

I don’t think I am a sysop of MediaWiki.org. I’m only running my own mediawiki Instance on a server right now.

I don’t l know if this is a developer question. But I’m looking for help on how to do this since the MediaWiki documentation does not mention this anywhere.

And most of the sites on the Support Desk are dead anyways.(Including IRC)

I’ll explain in more detail:
I want to assign roles to users automatically based on the domain of the email when they confirm their email. The email EmailAuthorization extension does not do this as far as I know. Do I need to build an extension for this for is this something that already exists in Wikimedia since I can assume you guys must have to deal with banning users from certain domains.

RazeSoldier

This is a strange demand. I found a similar hook, it called immediately after a local user has been created and saved to the database, not called immediately after user confirmed. I hope it can help you.

daegontaven

@RazeSoldier Thanks a lot! Just what I was looking for :smile: !

Tgr

No, we don’t do anything like this for Wikimedia, all user groups are hand-assigned. (Frankly, that seems like the easiest solution. How often do you expect to get new sysops?)

If you are not afraid of writing code, it is not too hard to do though.You’d need to implement the LocalUserCreated and UserSetEmail when $wgEmailAuthentication is false and ConfirmEmailComplete when it is true.

Tgr

Or you could go the other way and use UserEffectiveGroups, that’s probably easier.