How do I create my own custom group in mediawiki?

jeph perro picture jeph perro · Oct 20, 2008 · Viewed 28.6k times · Source

I have been reading carefully through the mediawiki documentation but I have not been able to find out how to create new groups.

When I look at Special:Userrights, I see only 3 groups : Bots, Sysops, Bureaycrats

I would like to create my own custom groups, so I can use some extensions like the http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control.

Can someone tell me how it's done, or point me to some documentation?

Answer

richardkmiller picture richardkmiller · Oct 21, 2008

You can add permissions for new groups to your LocalSettings.php file and they will automatically appear in the Special:UserRights page.

For example, I wanted to disallow editing by regular users but create a "Trusted" group that was allowed to edit. The following code creates a "Trusted" group that is equal to the "user" group, except that "Trusted" users can edit but "user" users cannot.

$wgGroupPermissions['Trusted'] = $wgGroupPermissions['user'];
$wgGroupPermissions['user'   ]['edit']          = false;
$wgGroupPermissions['Trusted']['edit']          = true;
$wgGroupPermissions['sysop'  ]['edit']          = true;

On the Special:UserRights page, I can now check the "Trusted" box to make users trusted.