Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:User rights

From mediawiki.org
Translate this page
Languages:

User rights are permissions (such as the ability to edit pages or to block users) that can be assigned to differentuser groups.MediaWiki ships with a default set of user rights and user groups, but these can be customized.This page explains the default rights and groups, and how to customize them.

For information about how to add and remove individual wiki users from groups, seeHelp:User rights and groups andManual:Setting user groups in MediaWiki.

Changing group permissions

A default MediaWiki installation assigns certain rights to default groups (see table at#List of permissions).You can change the default rights by editing the$wgGroupPermissions array inLocalSettings.php with the following syntax:

$wgGroupPermissions['group']['right']=true/* or false */;
In a default installation$wgGroupPermissions will be set inincludes/DefaultSettings.php, but it isnot present inLocalSettings.php. You will then need to add it in that file.

If a member has multiple groups, they get all 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.

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 withconfirmed 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' ] wheregroup-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)

By default, bureaucrats can add users to, or remove them from, any group.However, if you are using$wgAddGroups and$wgRemoveGroups, you may need to customize those instead.

Examples

This example will create an arbitraryprojectmember group that can block users and delete pages, and whose edits are hidden by default in the recent changes log:

$wgGroupPermissions['projectmember']['bot']=true;$wgGroupPermissions['projectmember']['block']=true;$wgGroupPermissions['projectmember']['delete']=true;
The group name cannot contain spaces, so use'random-group' or'random_group' instead of'random group'. Moreover it is recommended to only use lowercase letters to create a group.

In this example, you would probably also want to create these pages:

  • MediaWiki:Group-projectmember (content:Project members)
  • MediaWiki:Group-projectmember-member (content:Project member)
  • MediaWiki:Grouppage-projectmember (content:Project:Project Members)

This will ensure that the group will be referred to as "Project members" throughout the interface, and a member will be referred to as a "Project member", and overviews will link the group name toProject:Project members.

This example disables write access (page editing and creation) by default, creates a group namedwriter, and grants it write access.Users can be manually added to this group viaSpecial:UserRights:

$wgGroupPermissions['*']['edit']=false;$wgGroupPermissions['*']['createpage']=false;$wgGroupPermissions['user']['edit']=false;$wgGroupPermissions['user']['createpage']=false;$wgGroupPermissions['writer']['edit']=true;$wgGroupPermissions['writer']['createpage']=true;

In this example, you would probably also want to create these pages:

  • MediaWiki:Group-writer (content:Writers)
  • MediaWiki:Group-writer-member (content:Writer)
  • MediaWiki:Grouppage-writer (content:Project:Write)

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.

Example

This example will eliminate thebureaucrat 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 atSpecial:ListGroupRights; however, merely unsetting$wgGroupPermissions will suffice to remove it fromSpecial:UserRights.

unset($wgGroupPermissions['bureaucrat']);unset($wgRevokePermissions['bureaucrat']);unset($wgAddGroups['bureaucrat']);unset($wgRemoveGroups['bureaucrat']);unset($wgGroupsAddToSelf['bureaucrat']);unset($wgGroupsRemoveFromSelf['bureaucrat']);

This code will not work if any extension that modifies the default rights for thebureaucrat group, such asExtension:AntiSpoof, is installed.

Tracked inPhabricator
Task T275334
Open

More broadly, to disable a user group created by an extension, the above code needs to run after all extensions have been registered.This used to be possible by registering an extension function inLocalSettings.php:

$wgExtensionFunctions[]=function()use(&$wgGroupPermissions){unset($wgGroupPermissions['oversight']);unset($wgGroupPermissions['flow-bot']);};

However, thisno longer works reliably due toT275334.

Note on the group called "user"

With the above mechanism, you can remove the groupssysop,bureaucrat,bot,interface-admin,suppress, which - if used - can be assigned through the usualuser permission system.However, it is currently impossible to remove theuser group.This group isnot assigned through the usual permission system.Instead, every registered user automatically is a 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 atSpecial:Version on your wiki and see if your version is covered in the "Versions" column.

RightDescriptionUser groups that have this right by defaultVersions
Reading
readRead pages - when set tofalse, override for specific pages with$wgWhitelistRead
Setting theuser right'read' tofalse only restricts access to wiki pages (such as articles and talk pages).Uploaded files (including images, files, docs) under the$wgUploadPath subdirectories willalways remain publicly accessible via direct URL access by default.
To restrict access to uploaded files, refer to the instructions inManual:Image authorization andimg_auth.php.
*, user1.5+
Editing
applychangetagsApplytags along with one's changes - requires theedit rightuser1.25+
autocreateaccountAutomatically log in with an external user account - a more limited version ofcreateaccount1.27+
createaccountCreate new user accounts - register / registration*, sysop1.5+
createpageCreate pages (which are not discussion pages) - requires theedit right*, user1.6+
createtalkCreate discussion pages - requires theedit right*, user1.6+
delete-redirectDelete single revision redirects (note that this is not needed if the group already has thedelete right)1.36+
editEdit pages - requires theread right*, user1.5+
editsemiprotectedEdit pages protected as "Allow only autoconfirmed users" - without cascading protection - requires theedit rightautoconfirmed, bot, sysop1.22+
editprotectedEdit pages protected as "Allow only administrators" - without cascading protection - requires theedit rightsysop1.13+
minoreditMark edits as minor - requires theedit rightuser1.6+
moveMove pages - requires theedit rightuser, sysop1.5+
move-categorypagesMove category pages - requires themove rightuser, sysop1.25+
move-rootuserpagesMove root user pages - requires themove rightuser, sysop1.14+
move-subpagesMove pages with their subpages - requires themove rightuser, sysop1.13+
movefileMove files - requires themove right as welluser, sysop1.14+
reuploadOverwrite existing files - requires theupload rightuser, sysop1.6+
reupload-ownOverwrite existing files uploaded by oneself - requires theupload right (note that this is not needed if the group already has thereupload right)1.11+
reupload-sharedOverride files on the shared media repository locally - (if one is set up) with local files (requires theupload right)user, sysop1.6+
sendemailSend email to other usersuser1.16+
uploadUpload files - requires theedit right and$wgEnableUploads to be trueuser, sysop1.5+
upload_by_urlUpload files from a URL - requires theupload right (Prior to 1.20 it was given to sysops)1.8+
Management
bigdeleteDelete pages with large histories (as determined by$wgDeleteRevisionsLimit) - requires thedelete rightsysop1.12+
blockBlock or unblock other users from editing - Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP addresssysop1.5+
blockemailBlock or unblock a user from sending email - allows preventing use of theSpecial:Emailuser interface when blocking - requires theblock rightsysop1.11+
browsearchiveSearch deleted pages - throughSpecial:Undelete - requires thedeletedhistory rightsysop1.13+
changetagsAdd and remove arbitrarytags on individual revisions and log entries - currently unused by extensionsuser1.25+
deleteDelete pages1.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
sysop1.5+
deletedhistoryView deleted history entries, without their associated textsysop1.6+
deletedtextView deleted text and changes between deleted revisionssysop1.16+
deletelogentryDelete and undelete specific log entries - allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries - requires thedeleterevision rightsuppress1.20+
deleterevisionDelete and undelete specific revisions of pages - allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions(Split intodeleterevision anddeletelogentry in 1.20)suppress1.6+
editcontentmodelEdit the content model of a page - requires theedit rightuser1.23.7+
editinterfaceEdit the user interface - containsinterface messages. For editing sitewide CSS/JSON/JS, there are now segregate rights, see below. - requires theedit rightsysop, interface-admin1.5+
editmyoptionsEdit your own preferences*1.22+
editmyprivateinfoEdit your own private data (e.g. email address, real name) and request password reset emails - also hides the "Change Password", but not other ways to change the password - requires theviewmyprivateinfo right*1.22+
editmyusercssEdit your own user CSS files - prior to 1.31 it was assigned to everyone (i.e. "*") (note that this is not needed if the group already has theeditusercss right) - requires theedit rightuser1.22+
editmyuserjsEdit your own user JavaScript files - prior to 1.31 it was assigned to everyone (i.e. "*") (note that this is not needed if the group already has theedituserjs right) - requires theedit rightuser1.22+
editmyuserjsredirectEdit your own user JavaScript files that are redirects (note that this is not needed if the group already has theedituserjs right) - requires theedit right1.34+
editmyuserjsonEdit your own user JSON files (note that this is not needed if the group already has theedituserjson right) - requires theedit rightuser1.31+
editmywatchlistEdit your own watchlist (note that some actions will still add pages even without this right) - requires theviewmywatchlist rightuser1.22+
editsitecssEdit sitewide CSS - requires theeditinterface rightinterface-admin1.32+
editsitejsEdit sitewide JavaScript - requires theeditinterface rightinterface-admin1.32+
editsitejsonEdit sitewide JSON - requires theeditinterface rightsysop, interface-admin1.32+
editusercssEdit other users' CSS files - requires theedit rightinterface-admin1.16+
edituserjsEdit other users' JavaScript files - requires theedit rightinterface-admin1.16+
edituserjsonEdit other users' JSON files - requires theedit rightsysop, interface-admin1.31+
hideuserBlock or unblock a username, hiding or unhiding it from the public - Only users with 1000 edits or less can be suppressed by default - requires theblock right

Use$wgHideUserContribLimit to disable.

suppress1.10+
markboteditsMark rolled-back edits as bot edits - seeManual:Rollback - requires therollback rightsysop1.12+
mergehistoryMerge the history of pages - requires theedit rightsysop1.12+
pagelangChange page language -$wgPageLanguageUseDB must betrue1.24+
patrolMark others' edits as patrolled -$wgUseRCPatrol must betruesysop1.5+
patrolmarksView recent changes patrol marks (note that this is not needed if the group already has thepatrol right)1.16+
protectChange protection settings and edit cascade-protected pages - requires theedit rightsysop1.5+
rollbackQuickly rollback the edits of the last user who edited a particular page - requires theedit rightsysop1.5+
suppressionlogView private logssuppress1.6+
suppressrevisionView, hide and unhide specific revisions of pages from any user -Prior to1.13 this right was named hiderevision - requires thedeleterevision rightsuppress1.6+
unblockselfUnblock oneself - Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administratorsysop1.17+
undeleteUndelete a page - requires thedeletedhistory rightsysop1.12+
userrightsEdit 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

bureaucrat1.5+
userrights-interwikiEdit user rights of users on other wikis - requires theuserrights right1.12+
viewmyprivateinfoView your own private data (e.g. email address, real name)*1.22+
viewmywatchlistView your own watchlistuser1.22+
viewsuppressedView revisions hidden from any user - i.e. a more narrow alternative to "suppressrevision" (note that this is not needed if the group already has thesuppressrevision right)suppress1.24+
Administration
autopatrolHave one's own edits automatically marked as patrolled -$wgUseRCPatrol must betruebot, sysop1.9+
deletechangetagsDeletetags from the database - currently unused by extensionssysop1.28+
importImport pages from other wikis - "transwiki" - requires theedit rightsysop1.5+
importuploadImport pages from a file upload - This right was called 'importraw' in and before version 1.5 - requires theedit rightsysop1.5+
managechangetagsCreate and (de)activatetags - currently unused by extensionssysop1.25+
renameuserRename users (formerly was part of the Renameuser extension)bureaucrat1.40+
siteadminLock and unlock the database - which blocks all interactions with the web site except viewing. (not available by default)1.5+
unwatchedpagesView a list of unwatched pages - lists pages that no user has watchlistedsysop1.6+
Technical
apihighlimitsUse higher limits in API queriesbot, sysop1.12+
autoconfirmedNot be affected by IP-based rate limits - used for the 'autoconfirmed' group, see the other table below for more information (note that this is not needed if the group already has thenoratelimit right)autoconfirmed, bot, sysop1.6+
botBe treated as an automated process - edits and logged actions are hidden from recent changes. can optionally be viewedbot1.5+
ipblock-exemptBypass IP blocks, auto-blocks and range blockssysop1.9+
nominornewtalkNot have minor edits to discussion pages trigger the new messages prompt - requires theminoredit rightbot1.9+
noratelimitNot be affected by rate limits - not affected byrate limits (prior to the introduction of this right, the configuration variable$wgRateLimitsExcludedGroups was used for this purpose)sysop, bureaucrat1.13+
override-export-depthExport pages including linked pages up to a depth of 5
With this right, you can define the depth of linked pages atSpecial:Export. Otherwise, the value of$wgExportMaxLinkDepth, which is 0 by default, will be used.
1.15+
suppressredirectNot create redirects from source pages when moving pages - requires themove rightbot, sysop1.12+
Although these permissions all control separate things, sometimes to perform certain actions you need multiple permissions. For example allowing people to edit but not read pages doesn't make sense, since in order to edit a page you must first be able to read it (Assuming no pages are allowlisted). Allowing uploads but not editing does not make sense, since in order to upload an image you must implicitly create an image description page, etc.


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.

GroupDescriptionDefault rightsVersions
*All users (including anonymous).createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, read, viewmyprivateinfo1.5+
tempTemporary user accounts (T330816)Similar to* group1.41+
userRegistered accounts. Doesnot include temporary accounts.applychangetags, changetags, createpage, createtalk, edit, editcontentmodel, editmyusercss, editmyuserjs, editmyuserjson, editmywatchlist, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, viewmywatchlist1.13+
autoconfirmedRegistered accounts at least as old as$wgAutoConfirmAge and having at least as many edits as$wgAutoConfirmCount.autoconfirmed, editsemiprotected1.6+
botAccounts with thebot right (intended for automated scripts).autoconfirmed, autopatrol, apihighlimits, bot, editsemiprotected, nominornewtalk, suppressredirect1.5+
sysopUsers who by default can delete and restore pages, block and unblock users, etc.apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, delete, deletedhistory, deletedtext, editinterface, editprotected, editsemiprotected, editsitejson, edituserjson, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, move, move-categorypages, move-rootuserpages, move-subpages, movefile, noratelimit, patrol, protect, reupload, reupload-shared, rollback, suppressredirect, unblockself, undelete, unwatchedpages, upload1.5+
interface-adminUsers who can edit sitewide CSS/JS.editinterface, editsitecss, editsitejs, editsitejson, editusercss, edituserjs, edituserjson1.32+
bureaucratUsers who can change the rights of other users by default and therefore have full access of the entire wiki.noratelimit, renameuser, userrights1.5+
suppressdeletelogentry, deleterevision, hideuser, suppressionlog, suppressrevision, viewsuppressed1.13+

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.


Default rights

The default rights are defined inMainConfigSchema.php.

Adding new rights

Information for coders only follows.

If you're adding a new right in core, for instance tocontrol a new special page, you arerequired to add it to the list of available rights inPermissionManager.php,$coreRights (example).If you'redoing so in an extension, you instead need to use$wgAvailableRights.

You probably also want to assign it to some user group by editing$wgGroupPermissions described above.

If you want this right to be accessible to external applications byOAuth or bybot passwords, then you will need to add it to a grant by editing$wgGrantPermissions.

// create projectmember-powers right$wgAvailableRights[]='projectmember-powers';// add projectmember-powers to the projectmember-group$wgGroupPermissions['projectmember']['projectmember-powers']=true;// add projectmember-powers to the 'basic' grant so we can use our projectmember powers over an API request$wgGrantPermissions['basic']['projectmember-powers']=true;

You also need to addright-[name] andaction-[name] interface messages to /languages/i18n/en.json (with documentation in qqq.json).The right-* messages can be seen onSpecial:ListGroupRights and the action-* messages are used in a sentence like "You do not have permission to ...".

See also

Events
Settings
Miscellaneous
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:User_rights&oldid=7749817#editinterface"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp