User rights are specific access and ability permissions that can be assigned to customizable user groups. Groups can then be assigned to (or removed from) users through the Special:Userrights special page. See Help:Assigning permissions.
Access to this interface is itself governed by the 'userrights' right, so only users in the 'bureaucrat' group can do it (in a default set-up). See Manual:Setting user groups in MediaWiki for information about managing and the assignment of user groups.
Changing group permissions
$wgGroupPermissions['group']['right'] = true /* or false */;
Note: In a default installation $wgGroupPermissions will be set in
includes/DefaultSettings.php, but it is not present in
LocalSettings.php. You will then need to add it in that file.
If a member has multiple groups, they get all of the permissions from each of the groups they are in. All users, including anonymous users, are in the
'*' group; all registered users are in the
'user' group. In addition to the default groups, you can arbitrarily create new groups using the same array.
This example will disable viewing of all pages not listed in $wgWhitelistRead, then re-enable for registered users only:
$wgGroupPermissions['*']['read'] = false; # The following line is not actually necessary, since it's in the defaults. Setting '*' to false doesn't disable rights for groups that have the right separately set to true! $wgGroupPermissions['user']['read'] = true;
This example will disable editing of all pages, then re-enable for users with confirmed email addresses only:
# Disable for everyone. $wgGroupPermissions['*']['edit'] = false; # Disable for users, too: by default 'user' is allowed to edit, even if '*' is not. $wgGroupPermissions['user']['edit'] = false; # Make it so users with confirmed email addresses are in the group. $wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED; # Hide group from user list. $wgImplicitGroups = 'emailconfirmed'; # Finally, set it to true for the desired group. $wgGroupPermissions['emailconfirmed']['edit'] = true;
Creating a new group and assigning permissions to it
You can create new user groups by defining permissions for the according group name in
$wgGroupPermissions['<group-name>'] where <group-name> is the actual name of the group.
Additionally to assigning permissions, you should create these three wiki pages with fitting content:
- MediaWiki:Group-<group-name> (content:
Name of the group)
- MediaWiki:Group-<group-name>-member (content:
Name of a member of the group)
- MediaWiki:Grouppage-<group-name> (content:
Name of the group page)
This example will create an arbitrary "ninja" group that can block users and delete pages, and whose edits are hidden by default in the recent changes log:
$wgGroupPermissions['ninja']['bot'] = true; $wgGroupPermissions['ninja']['block'] = true; $wgGroupPermissions['ninja']['delete'] = true;
- Note: the group name cannot contain spaces, so use
In this example, you would probably also want to create these pages:
- MediaWiki:Group-ninja (content:
- MediaWiki:Group-ninja-member (content:
- MediaWiki:Grouppage-ninja (content:
This will ensure 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 group name to Project:Ninjas.
This example disables write access (page editing and creation) by default, creates a group named "Write", and grants it write access. Users can be manually added to this group via Special:UserRights:
$wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['user']['createpage'] = false; $wgGroupPermissions['Write']['edit'] = true; $wgGroupPermissions['Write']['createpage'] = true;
In this example, you would probably also want to create these pages:
- MediaWiki:Group-Write (content:
- MediaWiki:Group-Write-member (content:
- MediaWiki:Grouppage-Write (content:
Removing predefined groups
MediaWiki out of the box comes with a number of predefined groups. Most of these groups can be removed by unsetting the according array keys, among them
$wgGroupPermissions['<group-name>']. For details see below.
This example will eliminate the bureaucrat group entirely. It is necessary to ensure that all six of these variables are unset for any group that one wishes to remove from being listed at Special:ListGroupRights; however, merely unsetting $wgGroupPermissions will suffice to remove it from Special:UserRights. This code should be placed after any
require_once lines that add extensions such as Extension:Renameuser containing code that gives bureaucrats group permissions by default.
unset( $wgGroupPermissions['bureaucrat'] ); unset( $wgRevokePermissions['bureaucrat'] ); unset( $wgAddGroups['bureaucrat'] ); unset( $wgRemoveGroups['bureaucrat'] ); unset( $wgGroupsAddToSelf['bureaucrat'] ); unset( $wgGroupsRemoveFromSelf['bureaucrat'] );
Note on the group called "user"
With the above mechanism, you can remove the groups sysop, bureaucrat and bot, which - if used - can be assigned through the usual user permission system. However, it is currently impossible to remove the user group. This group is not assigned through the usual permission system. Instead, every logged in user automatically is member of that group. This is hardcoded in MediaWiki and currently cannot be changed easily.
List of permissions
The following user rights are available in the latest version of MediaWiki. If you are using an older version, look at "Special:Version" on your wiki and see if your version is covered in the "versions" column.
|Right||Description||User groups that have this right by default||Versions|
|read||Read pages - when set to false, override for specific pages with $wgWhitelistRead
|edit||Edit pages||*, user||1.5+|
|createpage||Create pages (which are not discussion pages) - requires the edit right||*, user||1.6+|
|createtalk||Create discussion pages - requires the edit right||*, user||1.6+|
|move||Move pages - requires the edit right||user||1.5+|
|movefile||Move files - requires the move right and $wgAllowImageMoving to be true||user||1.14+|
|move-subpages||Move pages with their subpages - requires the move right||user||1.13+|
|move-rootuserpages||Move root user pages - requires the move right||user||1.14+|
|move-categorypages||Move category pages - (requires the move right)||user||1.25+|
|createaccount||Create new user accounts - register / registration||*||1.5+|
|autocreateaccount||Automatically log in with an external user account - a more limited version of createaccount||—||1.27+|
|upload||Upload files - requires the edit right||user||1.5+|
|reupload||Overwrite existing files - requires the upload right||user||1.6+|
|reupload-own||Overwrite existing files uploaded by oneself - requires the upload right||—||1.11+|
|reupload-shared||Override files on the shared media repository locally - (if one is set up) with local files (requires the upload right)||user||1.6+|
|upload_by_url||Upload files from a URL - requires the upload right||—||1.8+|
|editprotected||Edit pages protected as "Allow only administrators" - without cascading protection||sysop||1.13+|
|editsemiprotected||Edit pages protected as "Allow only autoconfirmed users" - without cascading protection||autoconfirmed||1.22+|
|applychangetags||Apply tags along with one's changes||user||1.25+|
|delete||Delete pages 1.5–1.11: allows the deletion or undeletion of pages.
1.12+: allows the deletion of pages. For undeletions, there is now the 'undelete' right, see below
|bigdelete||Delete pages with large histories||sysop||1.12+|
|deletedhistory||View deleted history entries, without their associated text||sysop||1.6+|
|deletedtext||View deleted text and changes between deleted revisions||sysop|
|undelete||Undelete a page||sysop||1.12+|
|browsearchive||Search deleted pages - through Special:Undelete||sysop||1.13+|
|mergehistory||Merge the history of pages||sysop||1.12+|
|protect||Change protection levels and edit cascade-protected pages||sysop||1.5+|
|block||Block other users from editing - Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address||sysop||1.5+|
|blockemail||Block a user from sending email - allows preventing use of the Special:Emailuser interface when blocking||sysop||1.11+|
|hideuser||Block a username, hiding it from the public - (not available by default)
Only users with 1000 edits or less can be suppressed by default. Use
|unblockself||Unblock oneself - Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator||sysop||1.17+|
|userrights||Edit all user rights - allows the assignment or removal of all* groups to any user.
* With $wgAddGroups and $wgRemoveGroups you can set the possibility to add/remove certain groups instead of all
|userrights-interwiki||Edit user rights of users on other wikis||—||1.12+|
|rollback||Quickly rollback the edits of the last user who edited a particular page||sysop||1.5+|
|markbotedits||Mark rolled-back edits as bot edits - see Manual:Administrators#Rollback||sysop||1.12+|
|pagelang||Change page language - $wgPageLanguageUseDB must be true||—||1.24+|
|patrol||Mark others' edits as patrolled - $wgUseRCPatrol must be true||sysop||1.5+|
|patrolmarks||View recent changes patrol marks||—||1.16+|
|changetags||Add and remove arbitrary tags on individual revisions and log entries - currently unused by extensions||user||1.25+|
|editcontentmodel||Edit the content model of a page||—||1.23.7+|
|editinterface||Edit the user interface - contains interface messages||sysop||1.5+|
|⧼right-editusercssjs⧽ - Split into editusercss and edituserjs in 1.16 and deprecated, removed in 1.29||—||1.12+|
|editusercss||Edit other users' CSS files||sysop||1.16+|
|editmyusercss||Edit your own user CSS files||*||1.22+|
|editmywatchlist||Edit your own watchlist. Note some actions will still add pages even without this right.||*||1.22+|
|viewmywatchlist||View your own watchlist||*||1.22+|
|editmyprivateinfo||Edit your own private data (e.g. email address, real name)||*||1.22+|
|viewmyprivateinfo||View your own private data (e.g. email address, real name)||*||1.22+|
|editmyoptions||Edit your own preferences||*||1.22+|
|suppressrevision||View, hide and unhide specific revisions of pages from any user - Prior to 1.13 this right was named hiderevision (not available by default)||—||1.6+|
|viewsuppressed||View revisions hidden from any user - i.e. a more narrow alternative to "suppressrevision" (not available by default)||—||1.24+|
|deletelogentry||Delete and undelete specific log entries - allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries (not available by default)||—||1.20+|
|deleterevision||Delete and undelete specific revisions of pages - allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions Split into deleterevision and deletelogentry in 1.20 (not available by default)||—||1.6+|
|siteadmin||Lock and unlock the database - which blocks all interactions with the web site except viewing. Disabled by default||—||1.5+|
|import||Import pages from other wikis - "transwiki"||sysop||1.5+|
|importupload||Import pages from a file upload - This right was called 'importraw' in and before version 1.5||sysop||1.5+|
|Obsolete. Allows removal of trackbacks (if $wgUseTrackbacks is true)||—||1.7 - 1.18|
|unwatchedpages||View a list of unwatched pages - lists pages that no user has watchlisted||sysop||1.6+|
|managechangetags||Create and (de)activate tags - currently unused by extenions||sysop||1.25+|
|bot||Be treated as an automated process - can optionally be viewed||bot||1.5+|
|purge||Purge the site cache for a page without confirmation - URL parameter "
|minoredit||Mark edits as minor||user||1.6+|
|nominornewtalk||Not have minor edits to discussion pages trigger the new messages prompt - requires minor edit right||bot||1.9+|
|noratelimit||Not be affected by rate limits - not affected by rate limits (prior to the introduction of this right, the configuration variable $wgRateLimitsExcludedGroups was used for this purpose)||sysop, bureaucrat||1.13+|
|ipblock-exempt||Bypass IP blocks, auto-blocks and range blocks||sysop||1.9+|
|autopatrol||Have one's own edits automatically marked as patrolled - $wgUseRCPatrol must be true||bot, sysop||1.9+|
|apihighlimits||Use higher limits in API queries||bot, sysop||1.12+|
|writeapi||Use of the write API||*, user, bot||1.13+|
|suppressredirect||Not create redirects from source pages when moving pages||bot, sysop||1.12+|
|autoconfirmed||Not be affected by IP-based rate limits - used for the 'autoconfirmed' group, see the other table below for more information||autoconfirmed, bot, sysop||1.6+|
|Obsolete. Was used for the 'emailconfirmed' group, see the other table below for more information||—||1.7 - 1.13|
List of groups
The following groups are available in the latest version of MediaWiki. If you are using an older version then some of these may not be implemented.
|*||all users (including anonymous).||createaccount, read, edit, createpage, createtalk, writeapi, editmyusercss, editmyuserjs, viewmywatchlist, editmywatchlist, viewmyprivateinfo, editmyprivateinfo, editmyoptions||1.5+|
|user||registered accounts.||move, move-subpages, move-rootuserpages, move-categorypages, movefile, read, edit, createpage, createtalk, writeapi, upload, reupload, reupload-shared, minoredit, purge, sendemail, applychangetags, changetags|
|autoconfirmed||registered accounts at least as old as $wgAutoConfirmAge and having at least as many edits as $wgAutoConfirmCount.||autoconfirmed, editsemiprotected||1.6+|
|Obsolete, but $wgEmailAuthentication still exists. Registered accounts with confirmed email addresses.||—||1.7 - 1.13|
|bot||accounts with the bot right (intended for automated scripts).||bot, autoconfirmed, editsemiprotected, nominornewtalk, autopatrol, suppressredirect, apihighlimits, writeapi||1.5+|
|sysop||users who by default can delete and restore pages, block and unblock users, et cetera.||block, createaccount, delete, bigdelete, deletedhistory, deletedtext, undelete, editinterface, editusercss, edituserjs, import, importupload, move, move-subpages, move-rootuserpages, move-categorypages, patrol, autopatrol, protect, editprotected, proxyunbannable, rollback, upload, reupload, reupload-shared, unwatchedpages, autoconfirmed, editsemiprotected, ipblock-exempt, blockemail, markbotedits, apihighlimits, browsearchive, noratelimit, movefile, unblockself, suppressredirect, upload_by_url, mergehistory, managechangetags||1.5+|
|bureaucrat||users who by default can change other users' rights.||userrights, noratelimit||1.5+|
|developer||A group for the 'siteadmin' right. The group is deprecated by default, as well as the right.||—||1.5|
From MW 1.12, you can create your own groups into which users are automatically promoted (as with autoconfirmed and emailconfirmed) using $wgAutopromote. You can even create any custom group by just assigning rights to them.
The default rights are defined in DefaultSettings.php.
- Default values in HEAD version: https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/DefaultSettings.php
- The default values in the latest stable MediaWiki release, version 1.29, are available here: https://phabricator.wikimedia.org/diffusion/MW/browse/REL1_29/includes/DefaultSettings.php
- Additional rights: you should be able to list all the permissions available on your wiki by running
Adding new rights
Information for coders only follows.
If you're adding a new right in core, for instance to control a new special page, you are required to add it to the list of available rights in User.php,
$mCoreRights (example). If you're doing so in an extension, you instead need to use $wgAvailableRights.
You probably also want to also assign it to some user group by editing $wgGroupPermissions described above.
// create ninja-powers right $wgAvailableRights = 'ninja-powers'; //add ninja-powers to the ninja-group $wgGroupPermissions['ninja']['ninja-powers'] = true; //add ninja-powers to the 'basic' grant so we can use our ninja powers over an API request $wgGrantPermissions['basic']['ninja-powers'] = true;
You also need to add
action-[name] interface messages to /languages/i18n/en.json (with documentation in qqq.json). The right-* messages can be seen on Special:ListGroupRights and the action-* messages are used in a sentence like "You do not have permission to ...".
- Special:ListGroupRights - links to this help page and might contain not yet documented rights
- Help:Assigning permissions - help page describing use of the Special:Userrights interface (for bureaucrats)
- Manual:Setting user groups in MediaWiki - information about managing and the assignment of user groups.
- Manual:$wgAddGroups, Manual:$wgRemoveGroups
- Manual:Preventing access - examples
- Manual:Establishing a hierarchy of bureaucrats
- Category:User rights extensions - Many extensions relating to user rights