From DIYinfo.org
| Important note: When you edit any page, you agree to release your contribution into the [public domain]. If you don't want this or can't do this because of license restrictions, please don't edit. |
This page describes user rights assignment and the use of $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups and Special:Userrights.
See Help:User rights for user rights and user groups in general.
Contents |
[edit] Default
MW 1.5|and after The default setting is:
- <source lang="php">$wgGroupPermissions['bureaucrat']['userrights'] = true;</source>
This means that a user in the 'bureaucrat' group can add/remove any group, using Special:Userrights.
[edit] Managing user rights of certain groups
This can be set using $wgAddGroups and $wgRemoveGroups. Introduced in 1.11, and behaviour changed in 1.12. For earlier versions you will need to use an extension.
[edit] 1.11
MW 1.11|only Here are some examples, assuming you haven't changed anything yet (so bureaucrat has still his default 'userrights' right).
- Example: If a group (bureaucrat in this case) can remove any group. Bureaucrat can't add any groups.
<source lang="php">$wgRemoveGroups['bureaucrat'] = true;</source>
- Example: If a group (bureaucrat in this case) can add only some groups (sysop and bot groups in this case). Bureaucrat can't remove any groups.
<source lang="php">$wgAddGroups['bureaucrat'] = array( 'sysop', 'bot' );</source>
- Example: You want a sysop to be able to add/remove the bot group, and a bureaucrat be able to add/remove all groups.
Set the following in your LocalSettings.php file: <source lang="php"> $wgAddGroups['sysop'] = array( 'bot' ); $wgRemoveGroups['sysop'] = array( 'bot' ); $wgGroupPermissions['sysop']['userrights'] = true; </source> This is for sysops. A bureaucrat has the 'userrights' right by default, so you don't need to set this unless you changed it in your LocalSettings.php.
[edit] 1.12
MW 1.12 Here are some examples, assuming you haven't changed anything yet (so bureaucrat has still his default 'userrights' right).
- Example: If a group (bureaucrat in this case) can remove any right. Bureaucrat can't add any groups.
<source lang="php"> $wgRemoveGroups['bureaucrat'] = true; $wgGroupPermissions['bureaucrat']['userrights'] = false; # Disable the whole Special:Userrights interface. </source>
- Example: If a group (bureaucrat in this case) can add only some groups (sysop and bot groups in this case). Bureaucrat can't remove any group.
<source lang="php"> $wgAddGroups['bureaucrat'] = array( 'sysop', 'bot' ); $wgGroupPermissions['bureaucrat']['userrights'] = false; # Disable the whole Special:Userrights interface. </source>
- Example: You want a sysop to be able to add/remove the bot group, and a bureaucrat be able to add/remove all groups.
Set the following in your LocalSettings.php file: <source lang="php"> $wgAddGroups['sysop'] = array( 'bot' ); $wgRemoveGroups['sysop'] = array( 'bot' ); </source>
- This is for sysops. A bureaucrat has the 'userrights' right by default, so you don't need to set this unless you changed it in your LocalSettings.php.
[edit] Managing user rights of users on foreign wikis
MW 1.12 This can be set using the right "userrights-interwiki", for example: <source lang="php">$wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true;</source>
(More information needed)
[edit] Extensions
There are various extensions for user rights management. Below are alternative ways described using core instead of extensions.
[edit] GiveRollback
Alternative ways for 1.11 and 1.12. Note that the actions are now logged in Special:Log/rights, not in Special:Log/gvrollback. MW 1.11|only
- Alternative way for the GiveRollback extension, for version 1.11 only.
Do not forget to replace 'other groups' by the groups a bureaucrat should be able to add/remove, e.g. 'sysop'! <source lang="php"> $wgAddGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgRemoveGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgGroupPermissions['bureaucrat']['userrights'] = true; # They need access to Special:Userrights $wgGroupPermissions['rollback']['rollback'] = true; # Add the actual group </source>
MW 1.12|only
- Alternative way for the GiveRollback extension, for version 1.12 only.
Do not forget to replace 'other groups' by the groups a bureaucrat should be able to add/remove, e.g. 'sysop'! <source lang="php"> $wgAddGroups['bureaucrat'] = array( 'rollback', 'other groups' ); $wgRemoveGroups['bureaucrat'] = array( 'rollback', 'other groups' ); $wgGroupPermissions['bureaucrat']['userrights'] = false; # Disable the whole Special:Userrights interface $wgGroupPermissions['rollback']['rollback'] = true; # Add the actual group </source>
[edit] MakeBot
Alternative ways for 1.11 and 1.12. Note that the actions are now logged in Special:Log/rights, not in Special:Log/makebot. MW 1.11|only
- Alternative way for the MakeBot extension, for version 1.11 only.
Do not forget to replace 'other groups' by the groups a bureaucrat should be able to add/remove, e.g. 'sysop'! <source lang="php"> $wgAddGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgRemoveGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgGroupPermissions['bureaucrat']['userrights'] = true; # They need access to Special:Userrights </source>
MW 1.12|only
- Alternative way for the MakeBot extension, for version 1.12 only.
Do not forget to replace 'other groups' by the groups a bureaucrat should be able to add/remove, e.g. 'sysop'! <source lang="php"> $wgAddGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgRemoveGroups['bureaucrat'] = array( 'bot', 'other groups' ); $wgGroupPermissions['bureaucrat']['userrights'] = false; # Disable the whole Special:Userrights interface </source>
