41

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, Bureaucrats

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?

TheDudeAbides
  • 1,821
  • 1
  • 21
  • 29
jeph perro
  • 6,242
  • 26
  • 90
  • 124
  • 1
    I beleive I have found the answer, I just need to add the UserGroup and the permission to the wgGroupPermissions array in the LocalSettings.php file. $wgGroupPermissions['TomatoUsers']['read'] = true; $wgGroupPermissions['TomatoUsers']['edit'] = false; – jeph perro Oct 20 '08 at 17:42

5 Answers5

62

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.

richardkmiller
  • 2,902
  • 3
  • 31
  • 29
8

You can alter the appearance of the group name by creating the following messages: (For a group named ninja:)

  • MediaWiki:Group-ninja (content: Ninjas)
  • MediaWiki:Group-ninja-member (content: ninja)
  • MediaWiki:Grouppage-ninja (content: Project:Ninjas)

This will insure that the group will be referred to as "Ninjas" throughout the interface, and a member will be referred to as a "ninja", and overviews will link the groupname to Project:Ninjas.

(source: http://www.mediawiki.org/wiki/Manual:User_rights#Examples)

sir KitKat
  • 177
  • 1
  • 2
  • 11
  • 1
    Adding this for SEO: Rename group in mediawiki – DBX12 Dec 11 '16 at 19:28
  • 1
    Search Engine Optimization, Google will show this now if you search something like 'Rename group in mediawiki' – DBX12 Dec 12 '16 at 10:37
  • 1
    This is a really useful addition to the accepted answer—thanks! I wondered forever why Bureaucrats, Interface administrators, and Administrators were all redlinks on Special:UserRights, but my own custom groups weren't. Now I know how to fix that! – TheDudeAbides Dec 16 '22 at 21:28
2

Here you will find a List of Permissions. http://www.mediawiki.org/wiki/Manual:User_rights

nevi
  • 21
  • 1
1

I don't have the reputation to vote up the first answer (which can also be added to extension initialization files), but for when you get to adding users to your groups you may want to consider directly editing the database (ie. if you need to sync the wiki groups with external information). If you open the database "wikidb" the "PREFIX_user_groups"* table contains the mapping between user IDs (ug_user) and group names (ug_group). This table, combined with the "PREFIX_user"* table's name information (user_name) and ID information (user_id), give you all the information to add and remove large numbers of users from groups.

* Replace "PREFIX" with the database prefix you used for your wiki.

Compholio
  • 733
  • 1
  • 9
  • 17
1

I beleive I have found the answer, I just need to add the UserGroup and the permission to the wgGroupPermissions array in the LocalSettings.php file.

$wgGroupPermissions['TomatoUsers']['read']  = true;
$wgGroupPermissions['TomatoUsers']['edit']  = false;
jeph perro
  • 6,242
  • 26
  • 90
  • 124