Manual:User rights
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.
This Special:UserRights interface was introduced in MediaWiki 1.5; see Manual:User rights (older versions) for earlier methods.
Contents |
[edit] Changing group permissions
A default MediaWiki installation assigns certain rights to default groups (see below). You can change the default rights by editing the $wgGroupPermissions array in LocalSettings.php with the syntax
$wgGroupPermissions['group']['right'] = true /* or false */;
(Note: by default install $wgGroupPermissions is not present and you will need to add it into the file)
If a member has multiple groups, they get the highest permission of any groups. 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.
[edit] Examples
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 e-mail 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 e-mail 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;
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 name cannot contain spaces, so use
'random-user'
or'random_user'
instead of'random user'
In this example, you would probably also want to create pages:
- 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.
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:UserGroupRights; 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'] );
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;
[edit] 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 | Versions | ||
---|---|---|---|---|
Reading | ||||
read | allows viewing pages (when set to false, override for specific pages with $wgWhitelistRead).
|
1.5+ | ||
Editing | ||||
edit | allows editing unprotected pages. | 1.5+ | ||
createpage | allows the creation of new pages (requires the edit right). | 1.6+ | ||
createtalk | allows the creation of new talk pages (requires the edit right). | 1.6+ | ||
move | allows renaming the titles of unprotected pages (requires the edit right). | 1.5+ | ||
movefile | allows renaming pages in the "File" namespace (requires the move right and $wgAllowImageMoving to be true). | 1.14+ | ||
move-subpages | move subpages along with page (requires the move right). | 1.13+ | ||
move-rootuserpages | can move root pages in the "User" namespace (requires the move right). | 1.14+ | ||
createaccount | allows the creation of new user accounts. | 1.5+ | ||
upload | allows the creation of new images and files (requires the edit right). | 1.5+ | ||
reupload | allows overwriting existing images and files (requires the upload right). | 1.6+ | ||
reupload-own | allows overwriting existing images and files uploaded by oneself (requires the upload right). | 1.11+ | ||
reupload-shared | allows replacing images and files from a shared repository (if one is set up) with local files (requires the upload right). | 1.6+ | ||
upload_by_url | allows uploading by entering the URL of an external image (requires the upload right). | 1.8+ | ||
editprotected | allows to edit protected pages (without cascading protection). | 1.13+ | ||
Management | ||||
delete | 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. |
1.5+ | ||
bigdelete | allows deletion of pages with larger than $wgDeleteRevisionsLimit revisions | 1.12+ | ||
deletedhistory | allows viewing deleted history entries, but not seeing or restoring revisions | 1.6+ | ||
deletedtext | allows viewing deleted revisions, but not restoring. | |||
undelete | allows the undeletion of pages. | 1.12+ | ||
browsearchive | allows prefix searching for titles of deleted pages through Special:Undelete. | 1.13+ | ||
mergehistory | allows access to Special:MergeHistory, to merge non-overlapping pages. Note: the right is not assigned to a user group by default, including on Wikimedia projects. |
1.12+ | ||
protect | allows locking a page to prevent edits and moves, and editing or moving locked pages. | 1.5+ | ||
block | allows the blocking of IP addresses, CIDR ranges, and registered users. Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address. | 1.5+ | ||
blockemail | allows preventing use of the Special:Emailuser interface when blocking. | 1.11+ | ||
hideuser | allows hiding the user/IP from the block log, active block list, and user list when blocking. (not available by default) | 1.10+ | ||
unblockself | allows a user to use the block interface to unblock themselves. Without it an administrator that has the capability to block cannot unblock themselves if blocked by another administrator. | 1.17+ | ||
userrights | allows the use of the user rights interface, which 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. |
1.5+ | ||
userrights-interwiki | allows changing user rights on other wikis. | 1.12+ | ||
rollback | allows one-click reversion of edits. | 1.5+ | ||
markbotedits | allows rollback to be marked as bot edits (see Manual:Administrators#Rollback). | 1.12+ | ||
patrol | allows marking edits as legitimate ($wgUseRCPatrol must be true). | 1.5+ | ||
editinterface | allows editing the MediaWiki namespace, which contains interface messages. | 1.5+ | ||
editusercssjs | allows editing *.css / *.js subpages of any user. Split into editusercss and edituserjs in 1.16 but retained for backward compatibility. | 1.12+ | ||
editusercss | allows editing *.css subpages of any user. | 1.16+ | ||
edituserjs | allows editing *.js subpages of any user. | 1.16+ | ||
suppressrevision | allows preventing deleted revision information from being viewed by sysops and prevents sysops from undeleting the hidden info. Prior to 1.13 this right was named hiderevision (not available by default) | 1.6+ | ||
deletelogentry | allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries (not available by default) | 1.20+ | ||
deleterevision | 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+ | ||
Administration | ||||
siteadmin | allows locking and unlocking the database (which blocks all interactions with the web site except viewing). Deprecated by default. | 1.5+ | ||
import | allows user to import one page per time from another wiki ("transwiki"). | 1.5+ | ||
importupload | allows user to import several pages per time from XML files. This right was called 'importraw' in and before version 1.5. | 1.5+ | ||
trackback | allows removal of trackbacks (if $wgUseTrackbacks is true). | 1.7+ | ||
unwatchedpages | allows access to Special:Unwatchedpages, which lists pages that no user has watchlisted. | 1.6+ | ||
Technical | ||||
bot | hides edits from recent changes lists and watchlists by default (can optionally be viewed). | 1.5+ | ||
purge | allows purging a page without a confirmation step (URL parameter "&action=purge "). |
1.10+ | ||
minoredit | allows marking an edit as 'minor'. | 1.6+ | ||
nominornewtalk | blocks new message notification when making minor edits to user talk pages (requires minor edit right). | 1.9+ | ||
noratelimit | not affected by rate limits (prior to the introduction of this right, the configuration variable $wgRateLimitsExcludedGroups was used for this purpose) | 1.13+ | ||
ipblock-exempt | makes user immune to blocks applied to his IP address or a range (CIDR) containing it. | 1.9+ | ||
proxyunbannable | makes user immune to the open proxy blocker, which is disabled by default ($wgBlockOpenProxies). | 1.7+ | ||
autopatrol | automatically marks all edits by the user as patrolled ($wgUseRCPatrol must be true). | 1.9+ | ||
apihighlimits | allows user to use higher limits for API queries | 1.12+ | ||
writeapi | controls access to the write API ($wgEnableWriteAPI must be true) | 1.13+ | ||
suppressredirect | Allows moving a page without automatically creating a redirect. | 1.12+ | ||
autoconfirmed | used for the 'autoconfirmed' group, see the other table below for more information. | 1.6+ | ||
emailconfirmed | used for the 'emailconfirmed' group, see the other table below for more information. | 1.7 - 1.13 |
[edit] 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.
Group | Description | Versions |
---|---|---|
* | all users (including anonymous). | 1.5+ |
user | registered accounts. | 1.5+ |
autoconfirmed | registered accounts at least as old as $wgAutoConfirmAge and having at least as many edits as $wgAutoConfirmCount. | 1.6+ |
emailconfirmed | registered accounts with confirmed email addresses. | 1.7 - 1.13 |
bot | accounts with the bot right (intended for automated scripts). | 1.5+ |
sysop | users who by default can delete and restore pages, block and unblock users, et cetera. | 1.5+ |
bureaucrat | users who by default can change other users' rights. | 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.
[edit] Default rights
The default rights are defined in DefaultSettings.php.
- Default values in trunk version: DefaultSettings.php
- Default values in MediaWiki latest stable version 1.19.0:
/** * Permission keys given to users in each group. * All users are implicitly in the '*' group including anonymous visitors; * logged-in users are all implicitly in the 'user' group. These will be * combined with the permissions of all groups that a given user is listed * in in the user_groups table. * * Note: Don't set $wgGroupPermissions = array(); unless you know what you're * doing! This will wipe all permissions, and may mean that your users are * unable to perform certain essential tasks or access new functionality * when new permissions are introduced and default grants established. * * Functionality to make pages inaccessible has not been extensively tested * for security. Use at your own risk! * * This replaces wgWhitelistAccount and wgWhitelistEdit */ $wgGroupPermissions = array(); /** @cond file_level_code */ // Implicit group for all visitors $wgGroupPermissions['*']['createaccount'] = true; $wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['edit'] = true; $wgGroupPermissions['*']['createpage'] = true; $wgGroupPermissions['*']['createtalk'] = true; $wgGroupPermissions['*']['writeapi'] = true; //$wgGroupPermissions['*']['patrolmarks'] = false; // let anons see what was patrolled // Implicit group for all logged-in accounts $wgGroupPermissions['user']['move'] = true; $wgGroupPermissions['user']['move-subpages'] = true; $wgGroupPermissions['user']['move-rootuserpages'] = true; // can move root userpages //$wgGroupPermissions['user']['movefile'] = true; // Disabled for now due to possible bugs and security concerns $wgGroupPermissions['user']['read'] = true; $wgGroupPermissions['user']['edit'] = true; $wgGroupPermissions['user']['createpage'] = true; $wgGroupPermissions['user']['createtalk'] = true; $wgGroupPermissions['user']['writeapi'] = true; $wgGroupPermissions['user']['upload'] = true; $wgGroupPermissions['user']['reupload'] = true; $wgGroupPermissions['user']['reupload-shared'] = true; $wgGroupPermissions['user']['minoredit'] = true; $wgGroupPermissions['user']['purge'] = true; // can use ?action=purge without clicking "ok" $wgGroupPermissions['user']['sendemail'] = true; // Implicit group for accounts that pass $wgAutoConfirmAge $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true; // Users with bot privilege can have their edits hidden // from various log pages by default $wgGroupPermissions['bot']['bot'] = true; $wgGroupPermissions['bot']['autoconfirmed'] = true; $wgGroupPermissions['bot']['nominornewtalk'] = true; $wgGroupPermissions['bot']['autopatrol'] = true; $wgGroupPermissions['bot']['suppressredirect'] = true; $wgGroupPermissions['bot']['apihighlimits'] = true; $wgGroupPermissions['bot']['writeapi'] = true; #$wgGroupPermissions['bot']['editprotected'] = true; // can edit all protected pages without cascade protection enabled // Most extra permission abilities go to this group $wgGroupPermissions['sysop']['block'] = true; $wgGroupPermissions['sysop']['createaccount'] = true; $wgGroupPermissions['sysop']['delete'] = true; $wgGroupPermissions['sysop']['bigdelete'] = true; // can be separately configured for pages with > $wgDeleteRevisionsLimit revs $wgGroupPermissions['sysop']['deletedhistory'] = true; // can view deleted history entries, but not see or restore the text $wgGroupPermissions['sysop']['deletedtext'] = true; // can view deleted revision text $wgGroupPermissions['sysop']['undelete'] = true; $wgGroupPermissions['sysop']['editinterface'] = true; $wgGroupPermissions['sysop']['editusercss'] = true; $wgGroupPermissions['sysop']['edituserjs'] = true; $wgGroupPermissions['sysop']['import'] = true; $wgGroupPermissions['sysop']['importupload'] = true; $wgGroupPermissions['sysop']['move'] = true; $wgGroupPermissions['sysop']['move-subpages'] = true; $wgGroupPermissions['sysop']['move-rootuserpages'] = true; $wgGroupPermissions['sysop']['patrol'] = true; $wgGroupPermissions['sysop']['autopatrol'] = true; $wgGroupPermissions['sysop']['protect'] = true; $wgGroupPermissions['sysop']['proxyunbannable'] = true; $wgGroupPermissions['sysop']['rollback'] = true; $wgGroupPermissions['sysop']['upload'] = true; $wgGroupPermissions['sysop']['reupload'] = true; $wgGroupPermissions['sysop']['reupload-shared'] = true; $wgGroupPermissions['sysop']['unwatchedpages'] = true; $wgGroupPermissions['sysop']['autoconfirmed'] = true; $wgGroupPermissions['sysop']['upload_by_url'] = true; $wgGroupPermissions['sysop']['ipblock-exempt'] = true; $wgGroupPermissions['sysop']['blockemail'] = true; $wgGroupPermissions['sysop']['markbotedits'] = true; $wgGroupPermissions['sysop']['apihighlimits'] = true; $wgGroupPermissions['sysop']['browsearchive'] = true; $wgGroupPermissions['sysop']['noratelimit'] = true; $wgGroupPermissions['sysop']['movefile'] = true; $wgGroupPermissions['sysop']['unblockself'] = true; $wgGroupPermissions['sysop']['suppressredirect'] = true; #$wgGroupPermissions['sysop']['mergehistory'] = true; #$wgGroupPermissions['sysop']['trackback'] = true; // Permission to change users' group assignments $wgGroupPermissions['bureaucrat']['userrights'] = true; $wgGroupPermissions['bureaucrat']['noratelimit'] = true; // Permission to change users' groups assignments across wikis #$wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true; // Permission to export pages including linked pages regardless of $wgExportMaxLinkDepth #$wgGroupPermissions['bureaucrat']['override-export-depth'] = true; #$wgGroupPermissions['sysop']['deleterevision'] = true; // To hide usernames from users and Sysops #$wgGroupPermissions['suppress']['hideuser'] = true; // To hide revisions/log items from users and Sysops #$wgGroupPermissions['suppress']['suppressrevision'] = true; // For private suppression log access #$wgGroupPermissions['suppress']['suppressionlog'] = true; /** * The developer group is deprecated, but can be activated if need be * to use the 'lockdb' and 'unlockdb' special pages. Those require * that a lock file be defined and creatable/removable by the web * server. */ # $wgGroupPermissions['developer']['siteadmin'] = true;
[edit] See also
- 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:$wgNamespaceProtection
- Manual:$wgAutopromote
- Manual:$wgAddGroups, Manual:$wgRemoveGroups
- Manual:Preventing access (examples)
- Manual:Establishing a hierarchy of bureaucrats
- Category:User rights extensions - Many extensions relating to user rights
Language: | English • español • français • Bahasa Indonesia • 日本語 • 한국어 • português do Brasil |
---|