Difference between revisions of "MediaWiki"

From CNM Wiki
Jump to: navigation, search
(Created page with "== Security == As any open-source software, the ''Wiki'' is vulnerable to external attacks: *https://www.mediawiki.org/wiki/Manual:Security *https://www.mediawiki.org/wiki...")
 
Line 1: Line 1:
 +
[[MediaWiki]] is
 +
 +
 +
==Groups (user roles)==
 +
<languages/>
 +
<translate>
 +
<!--T:1-->
 +
'''User rights''' are specific access and ability permissions that can be assigned to customizable ''user groups''.</translate>
 +
<translate>
 +
<!--T:2-->
 +
Groups can then be assigned to (or removed from) users through the <tvar|user-rights>[[Special:UserRights]]</> [[<tvar|help>Special:MyLanguage/Help:Special pages</>|special page]].
 +
</translate>
 +
<translate>
 +
<!--T:3-->
 +
See <tvar|1>{{ll|Help:User rights and groups}}</>.
 +
 +
<!--T:4-->
 +
Access to this interface is itself governed by the <tvar|userrights><code>userrights</code></> right, so only users in the <tvar|bureaucrat>{{int|Group-bureaucrat}}</> group can do it (in a default set-up).</translate>
 +
<translate>
 +
<!--T:5-->
 +
See <tvar|1>{{ll|Manual:Setting user groups in MediaWiki}}</> for information about managing and the assignment of user groups.
 +
 +
== Changing group permissions == <!--T:7-->
 +
 +
<!--T:8-->
 +
A default MediaWiki installation assigns certain rights to default groups (see below).</translate>
 +
<translate>
 +
<!--T:9-->
 +
You can change the default rights by editing the <tvar|GroupPermissions>{{ll|Manual:$wgGroupPermissions|$wgGroupPermissions}}</> array in <tvar|LocalSettings>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</> with the syntax.
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
$wgGroupPermissions['group']['right'] = true /* <translate><!--T:10--> or false</translate> */;
 +
</syntaxhighlight>
 +
 +
{{Note|1=<translate><!--T:11--> In a default installation <tvar|GroupPermissions>$wgGroupPermissions</> will be set in <tvar|DefaultSettings><code>includes/DefaultSettings.php</code></>, but it is ''not'' present in <tvar|LocalSettings><code>LocalSettings.php</code></>.</translate> <translate><!--T:12--> You will then need to add it in that file.</translate>}}
 +
 +
<translate>
 +
<!--T:13-->
 +
If a member has multiple groups, they get all of the permissions from each of the groups they are in.</translate>
 +
<translate>
 +
<!--T:14-->
 +
All users, including anonymous users, are in the <code>'*'</code> group; all registered users are in the <code>'user'</code> group.</translate>
 +
<translate>
 +
<!--T:15-->
 +
In addition to the default groups, you can arbitrarily create new groups using the same array.
 +
 +
=== Examples === <!--T:16-->
 +
 +
<!--T:17-->
 +
This example will disable viewing of all pages not listed in <tvar|WhitelistRead>{{ll|Manual:$wgWhitelistRead|$wgWhitelistRead}}</>, then re-enable for registered users only:
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
$wgGroupPermissions['*']['read']    = false;
 +
# <translate><!--T:18--> 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!</translate>
 +
$wgGroupPermissions['user']['read'] = true;
 +
</syntaxhighlight>
 +
 +
<translate>
 +
<!--T:21-->
 +
This example will disable editing of all pages, then re-enable for users with confirmed email addresses only:
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
# <translate><!--T:22--> Disable for everyone.</translate>
 +
$wgGroupPermissions['*']['edit']              = false;
 +
# <translate><!--T:23--> Disable for users, too: by default 'user' is allowed to edit, even if '*' is not.</translate>
 +
$wgGroupPermissions['user']['edit']          = false;
 +
# <translate><!--T:24--> Make it so users with confirmed email addresses are in the group.</translate>
 +
$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;
 +
# <translate><!--T:25--> Hide group from user list.</translate>
 +
$wgImplicitGroups[] = 'emailconfirmed';
 +
# <translate><!--T:26--> Finally, set it to true for the desired group.</translate>
 +
$wgGroupPermissions['emailconfirmed']['edit'] = true;
 +
</syntaxhighlight>
 +
 +
<translate>
 +
== Creating a new group and assigning permissions to it == <!--T:27-->
 +
 +
<!--T:28-->
 +
You can create new user groups by defining permissions for the according group name in <code>$wgGroupPermissions['<group-name>']</code> where ''<group-name>'' is the actual name of the group.
 +
 +
<!--T:29-->
 +
Additionally to assigning permissions, you should create these three wiki pages with fitting content:
 +
</translate>
 +
 +
* {{blue|MediaWiki:Group-<group-name>}} <translate><!--T:30--> (content: <code>Name of the group</code>)</translate>
 +
* {{blue|MediaWiki:Group-<group-name>-member}} <translate><!--T:31--> (content: <code>Name of a member of the group</code>)</translate>
 +
* {{blue|MediaWiki:Grouppage-<group-name>}} <translate><!--T:32--> (content: <code>Name of the group page</code>)</translate>
 +
 +
<translate>
 +
<!--T:33-->
 +
By default, bureaucrats can add users to, or remove them from, any group.</translate>
 +
<translate>
 +
<!--T:34-->
 +
However, if you are using <tvar|AddGroups>{{ll|Manual:$wgAddGroups}}</> and <tvar|RemoveGroups>{{ll|Manual:$wgRemoveGroups}}</>, you may need to customize those instead.
 +
 +
=== Examples === <!--T:35-->
 +
 +
<!--T:36-->
 +
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:
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
$wgGroupPermissions['ninja']['bot']    = true;
 +
$wgGroupPermissions['ninja']['block']  = true;
 +
$wgGroupPermissions['ninja']['delete'] = true;
 +
</syntaxhighlight>
 +
 +
:<translate><!--T:37--> '''Note:''' the group name cannot contain spaces, so use <code>'random-group'</code> or <code>'random_group'</code> instead of <code>'random group'</code></translate>
 +
 +
<translate>
 +
<!--T:38-->
 +
In this example, you would probably also want to create these pages:
 +
</translate>
 +
 +
* {{blue|MediaWiki:Group-ninja}} <translate><!--T:39--> (content: <code>Ninjas</code>)</translate>
 +
* {{blue|MediaWiki:Group-ninja-member}} <translate><!--T:40--> (content: <code>ninja</code>)</translate>
 +
* {{blue|MediaWiki:Grouppage-ninja}} <translate><!--T:41--> (content: <code>Project:Ninjas</code>)</translate>
 +
 +
<translate>
 +
<!--T:42-->
 +
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 {{blue|Project:Ninjas}}.
 +
 +
<!--T:43-->
 +
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 <tvar|UserRights>[[Special:UserRights]]</>:
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
$wgGroupPermissions['*']['edit'] = false;
 +
$wgGroupPermissions['*']['createpage'] = false;
 +
$wgGroupPermissions['user']['edit'] = false;
 +
$wgGroupPermissions['user']['createpage'] = false;
 +
$wgGroupPermissions['Write']['edit'] = true;
 +
$wgGroupPermissions['Write']['createpage'] = true;
 +
</syntaxhighlight>
 +
 +
<translate>
 +
<!--T:44-->
 +
In this example, you would probably also want to create these pages:
 +
</translate>
 +
 +
* {{blue|MediaWiki:Group-Write}} <translate><!--T:45--> (content: <code>Writers</code>)</translate>
 +
* {{blue|MediaWiki:Group-Write-member}} <translate><!--T:46--> (content: <code>Writer</code>)</translate>
 +
* {{blue|MediaWiki:Grouppage-Write}} <translate><!--T:47--> (content: <code>Project:Write</code>)</translate>
 +
 +
<translate>
 +
== Removing predefined groups == <!--T:48-->
 +
 +
<!--T:49-->
 +
MediaWiki out of the box comes with a number of predefined groups.</translate>
 +
<translate>
 +
<!--T:50-->
 +
Most of these groups can be removed by unsetting the according array keys, among them <code>$wgGroupPermissions['<group-name>']</code>.</translate>
 +
<translate>
 +
<!--T:51-->
 +
For details see below.
 +
 +
=== Example === <!--T:52-->
 +
 +
<!--T:53-->
 +
This example will eliminate the bureaucrat group entirely.</translate>
 +
<translate>
 +
<!--T:54-->
 +
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 <tvar|List>[[Special:ListGroupRights]]</>; however, merely unsetting $wgGroupPermissions will suffice to remove it from <tvar|UserRights>[[Special:UserRights]]</>.</translate>
 +
<translate>
 +
<!--T:55-->
 +
This code should be placed after any <code>require_once</code> lines that add extensions such as <tvar|RenameUser>{{ll|Extension:Renameuser}}</> containing code that gives bureaucrats group permissions by default.
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
unset( $wgGroupPermissions['bureaucrat'] );
 +
unset( $wgRevokePermissions['bureaucrat'] );
 +
unset( $wgAddGroups['bureaucrat'] );
 +
unset( $wgRemoveGroups['bureaucrat'] );
 +
unset( $wgGroupsAddToSelf['bureaucrat'] );
 +
unset( $wgGroupsRemoveFromSelf['bureaucrat'] );
 +
</syntaxhighlight>
 +
 +
<translate>
 +
<!--T:216-->
 +
In some extensions (Flow, Semantic MediaWiki, etc.), rights are added during extension registration or in a registration function. In this case, it could be necessary to use a registration function in LocalSettings.php to remove some predefined user groups:
 +
</translate>
 +
 +
<syntaxhighlight lang="php">
 +
$wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) {
 +
    unset( $wgGroupPermissions['oversight'] );
 +
    unset( $wgGroupPermissions['flow-bot'] );
 +
};
 +
</syntaxhighlight>
 +
 +
<translate>
 +
=== Note on the group called “user” === <!--T:202-->
 +
 +
<!--T:203-->
 +
With the above mechanism, you can remove the groups sysop, bureaucrat and bot, which - if used - can be assigned through the usual [[<tvar|help>Special:MyLanguage/Help:User rights and groups</>|user permission system]].
 +
</translate>
 +
<translate>
 +
<!--T:204-->
 +
However, it is currently impossible to remove the <code>user</code> group.</translate>
 +
<translate>
 +
<!--T:205-->
 +
This group is ''not'' assigned through the usual permission system.</translate>
 +
<translate>
 +
<!--T:206-->
 +
Instead, every logged in user automatically is member of that group.</translate>
 +
<translate>
 +
<!--T:207-->
 +
This is hardcoded in MediaWiki and currently cannot be changed easily.
 +
 +
== List of permissions == <!--T:56-->
 +
 +
<!--T:57-->
 +
The following user rights are available in the latest version of MediaWiki.</translate>
 +
<translate>
 +
<!--T:58-->
 +
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.
 +
</translate>
 +
 +
{|class="wikitable"
 +
|-
 +
!{{hl2}} | <translate><!--T:59--> Right</translate>
 +
!{{hl2}} | <translate><!--T:60--> Description</translate>
 +
!{{hl2}} | <translate><!--T:208--> User groups that have this right by default</translate>
 +
!{{hl2}} | <translate><!--T:61--> Versions</translate>
 +
|-
 +
|{{hl3}} colspan="4" |'''<translate><!--T:192--> Reading</translate>'''
 +
|-
 +
|valign="top"|read
 +
|{{int|right-read}} - <translate><!--T:63--> when set to false, override for specific pages with <tvar|WhitelistRead>{{ll|Manual:$wgWhitelistRead|$wgWhitelistRead}}</></translate>
 +
----
 +
{{Uploaded-files-access-restriction-info}}
 +
| *, user
 +
| [[rev:9367|1.5+]]
 +
|-
 +
|{{hl3}} colspan="4"|'''<translate><!--T:193--> Editing</translate>'''
 +
|-
 +
|applychangetags
 +
|{{int|right-applychangetags}}
 +
|user
 +
|1.25+
 +
|-
 +
|autocreateaccount
 +
|{{int|right-autocreateaccount}} - <translate><!--T:210--> a more limited version of ''createaccount''</translate>
 +
|—
 +
|1.27+
 +
|-
 +
|createaccount
 +
|{{int|right-createaccount}} - register / registration
 +
|*
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|createpage
 +
|{{int|right-createpage}} - <translate><!--T:66--> requires the <tvar|1>''edit''</> right</translate>
 +
|*, user
 +
|[[rev:11973|1.6+]]
 +
|-
 +
|createtalk
 +
|{{int|right-createtalk}} - <translate><!--T:67--> requires the <tvar|1>''edit''</> right</translate>
 +
|*, user
 +
|[[rev:11973|1.6+]]
 +
|-
 +
|edit
 +
|{{int|right-edit}}
 +
|*, user
 +
|[[rev:9632|1.5+]]
 +
|-
 +
|editsemiprotected
 +
|{{int|right-editsemiprotected}} - <translate><!--T:79--> without cascading protection</translate>
 +
|autoconfirmed
 +
|1.22+
 +
|-
 +
|editprotected
 +
|{{int|right-editprotected}} - <translate><!--T:78--> without cascading protection</translate>
 +
|sysop
 +
|[[rev:32164|1.13+]]
 +
|-
 +
|move
 +
|{{int|right-move}} - <translate><!--T:68--> requires the <tvar|1>''edit''</> right</translate>
 +
|user
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|move-categorypages
 +
|{{int|right-move-categorypages}} - <translate><!--T:209--> (requires the <tvar|1>''move''</> right)</translate>
 +
|user
 +
|1.25+
 +
|-
 +
|move-rootuserpages
 +
|{{int|right-move-rootuserpages}} - <translate><!--T:71--> requires the <tvar|1>''move''</> right</translate>
 +
|user
 +
|[[rev:41961|1.14+]]
 +
|-
 +
|move-subpages
 +
|{{int|right-move-subpages}} - <translate><!--T:70--> requires the <tvar|1>''move''</> right</translate>
 +
|user
 +
|[[rev:35213|1.13+]]
 +
|-
 +
|movefile
 +
|{{int|right-movefile}} - <translate><!--T:69--> requires the <tvar|1>''move''</> right and <tvar|AllowImageMoving>{{ll|Manual:$wgAllowImageMoving|$wgAllowImageMoving}}</> to be true</translate>
 +
|user
 +
|[[rev:45276|1.14+]]
 +
|-
 +
|reupload
 +
|{{int|right-reupload}} - <translate><!--T:74--> requires the <tvar|1>''upload''</> right</translate>
 +
|user
 +
|[[rev:10906|1.6+]]
 +
|-
 +
|reupload-own
 +
|{{int|right-reupload-own}} - <translate><!--T:75--> requires the <tvar|1>''upload''</> right (note that this is not needed if the group already has the <tvar|reupload>''reupload''</> right)</translate>
 +
|—
 +
|[[rev:21943|1.11+]]
 +
|-
 +
|reupload-shared
 +
|{{int|right-reupload-shared}} - <translate><!--T:76--> (if one is set up) with local files</translate> <translate><!--T:211--> (requires the <tvar|1>''upload''</> right)</translate>
 +
|user
 +
|[[rev:10906|1.6+]]
 +
|-
 +
|sendemail
 +
|{{int|right-sendemail}}
 +
|user
 +
|[[rev:56962|1.16+]]
 +
|-
 +
|upload
 +
|{{int|right-upload}} - <translate><!--T:73--> requires the <tvar|1>''edit''</> right</translate>
 +
|user
 +
|[[rev:9499|1.5+]]
 +
|-
 +
|upload_by_url
 +
|{{int|right-upload_by_url}} - <translate><!--T:77--> requires the <tvar|1>''upload''</> right</translate>
 +
|—
 +
|[[rev:16162|1.8+]]
 +
|-
 +
|{{hl3}} colspan="4"|'''<translate><!--T:194--> Management</translate>'''
 +
|-
 +
|bigdelete
 +
|{{int|right-bigdelete}}
 +
|sysop
 +
|[[rev:29872|1.12+]]
 +
|-
 +
|block
 +
|{{int|right-block}} - <translate><!--T:92--> Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address</translate>
 +
|sysop
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|blockemail
 +
|{{int|right-blockemail}} - <translate><!--T:93--> allows preventing use of the [[Special:Emailuser]] interface when blocking</translate>
 +
|sysop
 +
|[[rev:22827|1.11+]]
 +
|-
 +
|browsearchive
 +
|{{int|right-browsearchive}} - <translate><!--T:89--> through [[Special:Undelete]]</translate>
 +
|sysop
 +
|[[rev:32456|1.13+]]
 +
|-
 +
|changetags
 +
|{{int|right-changetags}} - <translate><!--T:104--> currently unused by extensions</translate>
 +
|user
 +
|1.25+
 +
|-
 +
|delete
 +
|{{int|right-delete}} '''1.5–1.11:''' <translate><!--T:82--> allows the deletion or undeletion of pages.</translate><br />'''1.12+:''' <translate><!--T:83--> allows the deletion of pages.</translate> <translate><!--T:84--> For undeletions, there is now the <tvar|1>'undelete'</> right, see below</translate>
 +
|sysop
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|deletedhistory
 +
|{{int|right-deletedhistory}}
 +
|sysop
 +
|[[rev:12241|1.6+]]
 +
|-
 +
|deletedtext
 +
|{{int|right-deletedtext}}
 +
|sysop
 +
|
 +
|-
 +
|deletelogentry
 +
|{{int|right-deletelogentry}} - <translate><!--T:121--> allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries (''not available by default'')</translate>
 +
|—
 +
|[[gerrit:12889|1.20+]]
 +
|-
 +
|deleterevision
 +
|{{int|right-deleterevision}} - <translate><!--T:122--> allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions</translate> <translate><!--T:123--> '''Split into deleterevision and deletelogentry in 1.20''' (''not available by default'')</translate>
 +
|—
 +
|[[rev:13224|1.6+]]
 +
|-
 +
|editcontentmodel
 +
|{{int|right-editcontentmodel}}
 +
|—
 +
|[[gerrit:176201|1.23.7+]]
 +
|-
 +
|editinterface
 +
|{{int|right-editinterface}} - <translate><!--T:106--> contains [[<tvar|man>Special:MyLanguage/Manual:Interface</>|interface messages]]</translate>
 +
|sysop, interface-admin
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|editmyoptions
 +
|{{int|right-editmyoptions}}
 +
|*
 +
|1.22+
 +
|-
 +
|editmyprivateinfo
 +
|{{int|right-editmyprivateinfo}}
 +
|*
 +
|1.22+
 +
|-
 +
|editmyusercss
 +
|{{int|right-editmyusercss}}
 +
|*
 +
|1.22+
 +
|-
 +
|editmyuserjs
 +
| {{int|right-editmyuserjs}}
 +
|*
 +
|1.22+
 +
|-
 +
|editmyuserjson
 +
|{{int|right-editmyuserjson}}
 +
|user
 +
|[[gerrit:408940|1.31+]]
 +
|-
 +
|editmywatchlist
 +
|{{int|right-editmywatchlist}}
 +
|*
 +
|1.22+
 +
|-
 +
|editsitecss
 +
|{{int|right-editsitecss}}
 +
|interface-admin
 +
|[[gerrit:421121|1.32+]]
 +
|-
 +
|editsitejs
 +
|{{int|right-editsitejs}}
 +
|interface-admin
 +
|[[gerrit:421121|1.32+]]
 +
|-
 +
|editsitejson
 +
|{{int|right-editsitejson}}
 +
|interface-admin
 +
|[[gerrit:421121|1.32+]]
 +
|-
 +
|editusercss
 +
|{{int|right-editusercss}}
 +
|interface-admin
 +
|[[rev:54153|1.16+]]
 +
|-
 +
|edituserjs
 +
|{{int|right-edituserjs}}
 +
|interface-admin
 +
|[[rev:54153|1.16+]]
 +
|-
 +
|edituserjson
 +
|{{int|right-edituserjson}}
 +
|interface-admin
 +
|[[gerrit:408940|1.31+]]
 +
|-
 +
|hideuser
 +
|{{int|right-hideuser}} - <translate><!--T:94-->
 +
(''not available by default'')
 +
 +
<!--T:212-->
 +
Only users with 1000 edits or less can be suppressed by default.</translate> <translate><!--T:213--> Use <tvar|HideUserContribLimit>{{wg|HideUserContribLimit}}</> to disable.</translate>
 +
|—
 +
|[[rev:20446|1.10+]]
 +
|-
 +
|markbotedits
 +
|{{int|right-markbotedits}} - <translate><!--T:101--> see [[<tvar|man>Special:MyLanguage/Manual:Administrators#Rollback</>|Manual:Administrators#Rollback]]</translate>
 +
|sysop
 +
|[[rev:27658|1.12+]]
 +
|-
 +
|mergehistory
 +
|{{int|right-mergehistory}}
 +
|sysop
 +
|[[rev:27823|1.12+]]
 +
|-
 +
|pagelang
 +
|{{int|right-pagelang}} - <translate><!--T:214--> <tvar|PageLanguageUseDB>{{ll|Manual:$wgPageLanguageUseDB|$wgPageLanguageUseDB}}</> must be ''true''</translate>
 +
|—
 +
|[[gerrit:135312|1.24+]]
 +
|-
 +
|patrol
 +
|{{int|right-patrol}} - <translate><!--T:102--> <tvar|UseRCPatrol>{{ll|Manual:$wgUseRCPatrol|$wgUseRCPatrol}}</> must be ''true''</translate>
 +
|sysop
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|patrolmarks
 +
|{{int|right-patrolmarks}}
 +
|—
 +
|[[rev:54153|1.16+]]
 +
|-
 +
|protect
 +
|{{int|right-protect}}
 +
|sysop
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|rollback
 +
|{{int|right-rollback}}
 +
|sysop
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|suppressionlog
 +
|{{int|right-suppressionlog}}
 +
|—
 +
|[[rev:13224|1.6+]]
 +
|-
 +
|suppressrevision
 +
|{{int|right-suppressrevision}} - <translate><!--T:119--> '''Prior to [[rev:35303|1.13]] this right was named hiderevision''' (''not available by default'')</translate>
 +
|—
 +
|[[rev:13224|1.6+]]
 +
|-
 +
|unblockself
 +
|{{int|right-unblockself}} - <translate><!--T:96--> Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator</translate>
 +
|sysop
 +
|[[rev:64228|1.17+]]
 +
|-
 +
|undelete
 +
|{{int|right-undelete}}
 +
|sysop
 +
|[[rev:28151|1.12+]]
 +
|-
 +
|userrights
 +
|{{int|right-userrights}} - <translate><!--T:97--> allows the assignment or removal of all* groups to any user.</translate><br /><small><translate><!--T:98-->
 +
*With <tvar|AddGroups>{{ll|Manual:$wgAddGroups|$wgAddGroups}}</> and <tvar|RemoveGroups>{{ll|Manual:$wgRemoveGroups|$wgRemoveGroups}}</> you can set the possibility to add/remove certain groups instead of all</translate></small>
 +
|bureaucrat
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|userrights-interwiki
 +
|{{int|right-userrights-interwiki}}
 +
|—
 +
|[[rev:28650|1.12+]]
 +
|-
 +
|viewmyprivateinfo
 +
|{{int|right-viewmyprivateinfo}}
 +
|*
 +
|1.22+
 +
|-
 +
|viewmywatchlist
 +
|{{int|right-viewmywatchlist}}
 +
|*
 +
|1.22+
 +
|-
 +
|viewsuppressed
 +
|{{int|right-viewsuppressed}} - <translate><!--T:120--> i.e. a more narrow alternative to "suppressrevision" (''not available by default'')</translate>
 +
|—
 +
|[[gerrit:139277|1.24+]]
 +
|-
 +
|{{hl3}} colspan="4"|'''<translate><!--T:195--> Administration</translate>'''
 +
|-
 +
|autopatrol
 +
|{{int|right-autopatrol}} - <translate><!--T:141--> <tvar|UseRCPatrol>{{ll|Manual:$wgUseRCPatrol|$wgUseRCPatrol}}</> must be ''true''</translate>
 +
|bot, sysop
 +
|[[rev:18496|1.9+]]
 +
|-
 +
|import
 +
|{{int|right-import}} - <translate><!--T:126--> “transwiki”</translate>
 +
|sysop
 +
|[[rev:9498|1.5+]]
 +
|-
 +
|importupload
 +
|{{int|right-importupload}} - <translate><!--T:128--> This right was called 'importraw' in and before version 1.5</translate>
 +
|sysop
 +
|[[rev:9499|1.5+]]
 +
|-
 +
|managechangetags
 +
|{{int|right-managechangetags}} - <translate><!--T:132--> currently unused by extensions</translate>
 +
|sysop
 +
|1.25+
 +
|-
 +
|siteadmin
 +
|{{int|right-siteadmin}} - <translate><!--T:124--> which blocks all interactions with the web site except viewing.</translate> <translate><!--T:125--> Disabled by default</translate>
 +
|—
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|unwatchedpages
 +
|{{int|right-unwatchedpages}} - <translate><!--T:131--> lists pages that no user has watchlisted</translate>
 +
|sysop
 +
|[[rev:12196|1.6+]]
 +
|-
 +
|{{hl3}} colspan="4"|'''<translate><!--T:196--> Technical</translate>'''
 +
|-
 +
|apihighlimits
 +
|{{int|right-apihighlimits}}
 +
|bot, sysop
 +
|[[rev:27949|1.12+]]
 +
|-
 +
|autoconfirmed
 +
|{{int|right-autoconfirmed}} - <translate><!--T:145--> used for the 'autoconfirmed' group, see the other table below for more information</translate>
 +
|autoconfirmed, bot, sysop
 +
|[[rev:12207|1.6+]]
 +
|-
 +
|bot
 +
|{{int|right-bot}} - <translate><!--T:134--> can optionally be viewed</translate>
 +
|bot
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|ipblock-exempt
 +
|{{int|right-ipblock-exempt}}
 +
|sysop
 +
|[[rev:18904|1.9+]]
 +
|-
 +
|minoredit
 +
|{{int|right-minoredit}}
 +
|user
 +
|[[rev:12359|1.6+]]
 +
|-
 +
|nominornewtalk
 +
|{{int|right-nominornewtalk}} - <translate><!--T:137--> requires ''minor edit'' right</translate>
 +
|bot
 +
|[[rev:17281|1.9+]]
 +
|-
 +
|noratelimit
 +
|{{int|right-noratelimit}} - <translate><!--T:138--> not affected by [[<tvar|man>Special:MyLanguage/Manual:$wgRateLimits</>|rate limits]] (''prior to the introduction of this right, the configuration variable <tvar|RateLimitsExcludedGroups>{{ll|Manual:$wgRateLimitsExcludedGroups|$wgRateLimitsExcludedGroups}}</> was used for this purpose'')</translate>
 +
|sysop, bureaucrat
 +
|[[rev:35908|1.13+]]
 +
|-
 +
|purge
 +
|{{int|right-purge}} - <translate><!--T:135--> [[<tvar|man>Special:MyLanguage/Manual:URL</>|URL parameter]] "<code>&action=purge</code>"</translate>
 +
|user
 +
|[[rev:19195|1.10+]]
 +
|-
 +
|suppressredirect
 +
|{{int|right-suppressredirect}}
 +
|bot, sysop
 +
|[[rev:27774|1.12+]]
 +
|-
 +
|writeapi
 +
|{{int|right-writeapi}}
 +
|*, user, bot
 +
|[[rev:35399|1.13+]]
 +
|}
 +
{{Note|1=<translate><!--T:149--> Although these permissions all control separate things, sometimes to perform certain actions you need multiple permissions.</translate> <translate><!--T:150--> 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 whitelisted).</translate> <translate><!--T:151--> 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.</translate>}}
 +
 +
<translate>
 +
 +
== List of groups == <!--T:152-->
 +
 +
<!--T:153-->
 +
The following groups are available in the latest version of MediaWiki.</translate>
 +
<translate>
 +
<!--T:154-->
 +
If you are using an older version then some of these may not be implemented.
 +
</translate>
 +
 +
{|class="wikitable"
 +
|-
 +
!{{hl2}} | <translate><!--T:155--> Group</translate>
 +
!{{hl2}} | <translate><!--T:156--> Description</translate>
 +
!{{hl2}} | <translate><!--T:215--> Default rights</translate>
 +
!{{hl2}} | <translate><!--T:157--> Versions</translate>
 +
|-
 +
| *
 +
|<translate><!--T:158--> all users (including anonymous).</translate>
 +
|createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, editmyusercss, editmyuserjs, editmywatchlist, read, viewmyprivateinfo, viewmywatchlist, writeapi
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|user
 +
|<translate><!--T:159--> registered accounts.</translate>
 +
|applychangetags, changetags, createpage, createtalk, edit, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, writeapi
 +
|
 +
|-
 +
|autoconfirmed
 +
|<translate><!--T:160--> registered accounts at least as old as <tvar|AutoConfirmAge>{{ll|Manual:$wgAutoConfirmAge|$wgAutoConfirmAge}}</> and having at least as many edits as <tvar|AutoConfirmCount>{{ll|Manual:$wgAutoConfirmCount|$wgAutoConfirmCount}}</>.</translate>
 +
|autoconfirmed, editsemiprotected
 +
|[[rev:12207|1.6+]]
 +
|-
 +
|bot
 +
|<translate><!--T:163--> accounts with the ''bot'' right (intended for automated scripts).</translate>
 +
|autoconfirmed, autopatrol, apihighlimits, bot, editsemiprotected, nominornewtalk, suppressredirect, writeapi
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|sysop
 +
|<translate><!--T:164--> users who by default can delete and restore pages, block and unblock users, et cetera.</translate>
 +
|apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, delete, deletedhistory, deletedtext, editinterface, editprotected, editsemiprotected, editusercss, edituserjs, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, move, move-categorypages, move-rootuserpages, move-subpages, movefile, noratelimit, patrol, protect, proxyunbannable, reupload, reupload-shared, rollback, suppressredirect, unblockself, undelete, unwatchedpages, upload, upload_by_url
 +
|[[rev:9367|1.5+]]
 +
|-
 +
|bureaucrat
 +
|<translate><!--T:165--> users who by default can change other users' rights.</translate>
 +
|noratelimit, userrights
 +
|[[rev:9367|1.5+]]
 +
|}
 +
 +
<translate>
 +
<!--T:167-->
 +
From MW 1.12, you can create your own groups into which users are automatically promoted (as with autoconfirmed and emailconfirmed) using <tvar|AutoPromote>{{ll|Manual:$wgAutopromote|$wgAutopromote}}</>.</translate>
 +
<translate>
 +
<!--T:168-->
 +
You can even create any custom group by just assigning rights to them.
 +
 +
== Default rights == <!--T:169-->
 +
 +
<!--T:170-->
 +
The default rights are defined in <tvar|DefaultSettings>{{ll|Manual:DefaultSettings.php|DefaultSettings.php}}</>.</translate>
 +
<translate>
 +
<!--T:171-->
 +
* Default values in HEAD version:</translate> https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/DefaultSettings.php
 +
<translate>
 +
<!--T:172-->
 +
* The default values in the latest stable MediaWiki release, version {{MW stable branch number}}, are available here:</translate> https://phabricator.wikimedia.org/diffusion/MW/browse/{{#invoke:Version|get|stable|git}}/includes/DefaultSettings.php
 +
<translate>
 +
<!--T:173-->
 +
* Additional rights: you should be able to list all the permissions available on your wiki by running <tvar|getAllRights><code>User::getAllRights()</code></>.
 +
</translate>
 +
 +
{{anchor|Adding new rights}}
 +
<translate>
 +
=== Adding new rights === <!--T:175-->
 +
</translate>
 +
''<translate><!--T:176--> Information for coders only follows.</translate>''
 +
 +
<translate>
 +
<!--T:177-->
 +
If you're adding a new right in core, for instance to [[<tvar|man>Special:MyLanguage/Manual:Special pages</>|control a new special page]], you are ''required'' to add it to the list of available rights in <tvar|User>{{ll|Manual:User.php|User.php}}</>, <code>$mCoreRights</code> ([<tvar|url>https://gerrit.wikimedia.org/r/#/c/135312/73/includes/User.php</> example]).</translate>
 +
<translate>
 +
<!--T:178-->
 +
If you're {{<tvar|man>ll|Manual:Developing extensions</>|doing so in an extension}}, you instead need to use <tvar|AvailableRights>{{ll|Manual:$wgAvailableRights|$wgAvailableRights}}</>.
 +
 +
<!--T:179-->
 +
You probably also want to assign it to some user group by editing <tvar|GroupPermissions>{{ll|Manual:$wgGroupPermissions|$wgGroupPermissions}}</> described above.
 +
 +
<!--T:217-->
 +
If you want this right to be accessible to external applications by <tvar|OAuth>{{ll|Help:OAuth|OAuth}}</> or by [[<tvar|botpasswords>Manual:Bot passwords</>|bot passwords]], then you will need to add it to a grant by editing <tvar|GrantPermissions>{{ll|Manual:$wgGrantPermissions|$wgGrantPermissions}}</>.</translate>
 +
 +
<source lang="php">
 +
// 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;
 +
</source>
 +
 
== Security ==
 
== Security ==
 
As any [[open-source]] software, the ''Wiki'' is vulnerable to external attacks:
 
As any [[open-source]] software, the ''Wiki'' is vulnerable to external attacks:

Revision as of 00:55, 30 September 2018

MediaWiki is


Groups (user roles)

<languages/> <translate> User rights are specific access and ability permissions that can be assigned to customizable user groups.</translate> <translate> Groups can then be assigned to (or removed from) users through the <tvar|user-rights>Special:UserRights</> [[<tvar|help>Special:MyLanguage/Help:Special pages</>|special page]]. </translate> <translate> See <tvar|1>Template:Ll</>.

Access to this interface is itself governed by the <tvar|userrights>userrights</> right, so only users in the <tvar|bureaucrat>Template:Int</> group can do it (in a default set-up).</translate> <translate> See <tvar|1>Template:Ll</> for information about managing and the assignment of user groups.

Changing group permissions

A default MediaWiki installation assigns certain rights to default groups (see below).</translate> <translate> You can change the default rights by editing the <tvar|GroupPermissions>Template:Ll</> array in <tvar|LocalSettings>Template:Ll</> with the syntax. </translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['group']['right'] = true /* <translate> or false</translate> */; </syntaxhighlight>

Template:Note

<translate> If a member has multiple groups, they get all of the permissions from each of the groups they are in.</translate> <translate> All users, including anonymous users, are in the '*' group; all registered users are in the 'user' group.</translate> <translate> 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 <tvar|WhitelistRead>Template:Ll</>, then re-enable for registered users only: </translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['*']['read'] = false;

  1. <translate> 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!</translate>

$wgGroupPermissions['user']['read'] = true; </syntaxhighlight>

<translate> This example will disable editing of all pages, then re-enable for users with confirmed email addresses only: </translate>

<syntaxhighlight lang="php">

  1. <translate> Disable for everyone.</translate>

$wgGroupPermissions['*']['edit'] = false;

  1. <translate> Disable for users, too: by default 'user' is allowed to edit, even if '*' is not.</translate>

$wgGroupPermissions['user']['edit'] = false;

  1. <translate> Make it so users with confirmed email addresses are in the group.</translate>

$wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED;

  1. <translate> Hide group from user list.</translate>

$wgImplicitGroups[] = 'emailconfirmed';

  1. <translate> Finally, set it to true for the desired group.</translate>

$wgGroupPermissions['emailconfirmed']['edit'] = true; </syntaxhighlight>

<translate>

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: </translate>

  • Template:Blue <translate> (content: Name of the group)</translate>
  • Template:Blue <translate> (content: Name of a member of the group)</translate>
  • Template:Blue <translate> (content: Name of the group page)</translate>

<translate> By default, bureaucrats can add users to, or remove them from, any group.</translate> <translate> However, if you are using <tvar|AddGroups>Template:Ll</> and <tvar|RemoveGroups>Template:Ll</>, you may need to customize those instead.

Examples

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: </translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['ninja']['bot'] = true; $wgGroupPermissions['ninja']['block'] = true; $wgGroupPermissions['ninja']['delete'] = true; </syntaxhighlight>

<translate> Note: the group name cannot contain spaces, so use 'random-group' or 'random_group' instead of 'random group'</translate>

<translate> In this example, you would probably also want to create these pages: </translate>

<translate> 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 Template:Blue.

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 <tvar|UserRights>Special:UserRights</>: </translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['user']['createpage'] = false; $wgGroupPermissions['Write']['edit'] = true; $wgGroupPermissions['Write']['createpage'] = true; </syntaxhighlight>

<translate> In this example, you would probably also want to create these pages: </translate>

<translate>

Removing predefined groups

MediaWiki out of the box comes with a number of predefined groups.</translate> <translate> Most of these groups can be removed by unsetting the according array keys, among them $wgGroupPermissions['<group-name>'].</translate> <translate> For details see below.

Example

This example will eliminate the bureaucrat group entirely.</translate> <translate> 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 <tvar|List>Special:ListGroupRights</>; however, merely unsetting $wgGroupPermissions will suffice to remove it from <tvar|UserRights>Special:UserRights</>.</translate> <translate> This code should be placed after any require_once lines that add extensions such as <tvar|RenameUser>Template:Ll</> containing code that gives bureaucrats group permissions by default. </translate>

<syntaxhighlight lang="php"> unset( $wgGroupPermissions['bureaucrat'] ); unset( $wgRevokePermissions['bureaucrat'] ); unset( $wgAddGroups['bureaucrat'] ); unset( $wgRemoveGroups['bureaucrat'] ); unset( $wgGroupsAddToSelf['bureaucrat'] ); unset( $wgGroupsRemoveFromSelf['bureaucrat'] ); </syntaxhighlight>

<translate> In some extensions (Flow, Semantic MediaWiki, etc.), rights are added during extension registration or in a registration function. In this case, it could be necessary to use a registration function in LocalSettings.php to remove some predefined user groups: </translate>

<syntaxhighlight lang="php"> $wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) {

   unset( $wgGroupPermissions['oversight'] );
   unset( $wgGroupPermissions['flow-bot'] );

}; </syntaxhighlight>

<translate>

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 [[<tvar|help>Special:MyLanguage/Help:User rights and groups</>|user permission system]]. </translate> <translate> However, it is currently impossible to remove the user group.</translate> <translate> This group is not assigned through the usual permission system.</translate> <translate> Instead, every logged in user automatically is member of that group.</translate> <translate> 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.</translate> <translate> 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. </translate>

Template:Hl2 | <translate> Right</translate> Template:Hl2 | <translate> Description</translate> Template:Hl2 | <translate> User groups that have this right by default</translate> Template:Hl2 | <translate> Versions</translate>
Template:Hl3 colspan="4" |<translate> Reading</translate>
read Template:Int - <translate> when set to false, override for specific pages with <tvar|WhitelistRead>Template:Ll</></translate>

Template:Uploaded-files-access-restriction-info

*, user 1.5+
Template:Hl3 colspan="4"|<translate> Editing</translate>
applychangetags Template:Int user 1.25+
autocreateaccount Template:Int - <translate> a more limited version of createaccount</translate> 1.27+
createaccount Template:Int - register / registration * 1.5+
createpage Template:Int - <translate> requires the <tvar|1>edit</> right</translate> *, user 1.6+
createtalk Template:Int - <translate> requires the <tvar|1>edit</> right</translate> *, user 1.6+
edit Template:Int *, user 1.5+
editsemiprotected Template:Int - <translate> without cascading protection</translate> autoconfirmed 1.22+
editprotected Template:Int - <translate> without cascading protection</translate> sysop 1.13+
move Template:Int - <translate> requires the <tvar|1>edit</> right</translate> user 1.5+
move-categorypages Template:Int - <translate> (requires the <tvar|1>move</> right)</translate> user 1.25+
move-rootuserpages Template:Int - <translate> requires the <tvar|1>move</> right</translate> user 1.14+
move-subpages Template:Int - <translate> requires the <tvar|1>move</> right</translate> user 1.13+
movefile Template:Int - <translate> requires the <tvar|1>move</> right and <tvar|AllowImageMoving>Template:Ll</> to be true</translate> user 1.14+
reupload Template:Int - <translate> requires the <tvar|1>upload</> right</translate> user 1.6+
reupload-own Template:Int - <translate> requires the <tvar|1>upload</> right (note that this is not needed if the group already has the <tvar|reupload>reupload</> right)</translate> 1.11+
reupload-shared Template:Int - <translate> (if one is set up) with local files</translate> <translate> (requires the <tvar|1>upload</> right)</translate> user 1.6+
sendemail Template:Int user 1.16+
upload Template:Int - <translate> requires the <tvar|1>edit</> right</translate> user 1.5+
upload_by_url Template:Int - <translate> requires the <tvar|1>upload</> right</translate> 1.8+
Template:Hl3 colspan="4"|<translate> Management</translate>
bigdelete Template:Int sysop 1.12+
block Template:Int - <translate> Block options include preventing editing and registering new accounts, and autoblocking other users on the same IP address</translate> sysop 1.5+
blockemail Template:Int - <translate> allows preventing use of the Special:Emailuser interface when blocking</translate> sysop 1.11+
browsearchive Template:Int - <translate> through Special:Undelete</translate> sysop 1.13+
changetags Template:Int - <translate> currently unused by extensions</translate> user 1.25+
delete Template:Int 1.5–1.11: <translate> allows the deletion or undeletion of pages.</translate>
1.12+: <translate> allows the deletion of pages.</translate> <translate> For undeletions, there is now the <tvar|1>'undelete'</> right, see below</translate>
sysop 1.5+
deletedhistory Template:Int sysop 1.6+
deletedtext Template:Int sysop
deletelogentry Template:Int - <translate> allows deleting/undeleting information (action text, summary, user who made the action) of specific log entries (not available by default)</translate> 1.20+
deleterevision Template:Int - <translate> allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions</translate> <translate> Split into deleterevision and deletelogentry in 1.20 (not available by default)</translate> 1.6+
editcontentmodel Template:Int 1.23.7+
editinterface Template:Int - <translate> contains [[<tvar|man>Special:MyLanguage/Manual:Interface</>|interface messages]]</translate> sysop, interface-admin 1.5+
editmyoptions Template:Int * 1.22+
editmyprivateinfo Template:Int * 1.22+
editmyusercss Template:Int * 1.22+
editmyuserjs Template:Int * 1.22+
editmyuserjson Template:Int user 1.31+
editmywatchlist Template:Int * 1.22+
editsitecss Template:Int interface-admin 1.32+
editsitejs Template:Int interface-admin 1.32+
editsitejson Template:Int interface-admin 1.32+
editusercss Template:Int interface-admin 1.16+
edituserjs Template:Int interface-admin 1.16+
edituserjson Template:Int interface-admin 1.31+
hideuser Template:Int - <translate>

(not available by default)

Only users with 1000 edits or less can be suppressed by default.</translate> <translate> Use <tvar|HideUserContribLimit>Template:Wg</> to disable.</translate>

1.10+
markbotedits Template:Int - <translate> see [[<tvar|man>Special:MyLanguage/Manual:Administrators#Rollback</>|Manual:Administrators#Rollback]]</translate> sysop 1.12+
mergehistory Template:Int sysop 1.12+
pagelang Template:Int - <translate> <tvar|PageLanguageUseDB>Template:Ll</> must be true</translate> 1.24+
patrol Template:Int - <translate> <tvar|UseRCPatrol>Template:Ll</> must be true</translate> sysop 1.5+
patrolmarks Template:Int 1.16+
protect Template:Int sysop 1.5+
rollback Template:Int sysop 1.5+
suppressionlog Template:Int 1.6+
suppressrevision Template:Int - <translate> Prior to 1.13 this right was named hiderevision (not available by default)</translate> 1.6+
unblockself Template:Int - <translate> Without it, an administrator that has the capability to block cannot unblock themselves if blocked by another administrator</translate> sysop 1.17+
undelete Template:Int sysop 1.12+
userrights Template:Int - <translate> allows the assignment or removal of all* groups to any user.</translate>
<translate>
  • With <tvar|AddGroups>Template:Ll</> and <tvar|RemoveGroups>Template:Ll</> you can set the possibility to add/remove certain groups instead of all</translate>
bureaucrat 1.5+
userrights-interwiki Template:Int 1.12+
viewmyprivateinfo Template:Int * 1.22+
viewmywatchlist Template:Int * 1.22+
viewsuppressed Template:Int - <translate> i.e. a more narrow alternative to "suppressrevision" (not available by default)</translate> 1.24+
Template:Hl3 colspan="4"|<translate> Administration</translate>
autopatrol Template:Int - <translate> <tvar|UseRCPatrol>Template:Ll</> must be true</translate> bot, sysop 1.9+
import Template:Int - <translate> “transwiki”</translate> sysop 1.5+
importupload Template:Int - <translate> This right was called 'importraw' in and before version 1.5</translate> sysop 1.5+
managechangetags Template:Int - <translate> currently unused by extensions</translate> sysop 1.25+
siteadmin Template:Int - <translate> which blocks all interactions with the web site except viewing.</translate> <translate> Disabled by default</translate> 1.5+
unwatchedpages Template:Int - <translate> lists pages that no user has watchlisted</translate> sysop 1.6+
Template:Hl3 colspan="4"|<translate> Technical</translate>
apihighlimits Template:Int bot, sysop 1.12+
autoconfirmed Template:Int - <translate> used for the 'autoconfirmed' group, see the other table below for more information</translate> autoconfirmed, bot, sysop 1.6+
bot Template:Int - <translate> can optionally be viewed</translate> bot 1.5+
ipblock-exempt Template:Int sysop 1.9+
minoredit Template:Int user 1.6+
nominornewtalk Template:Int - <translate> requires minor edit right</translate> bot 1.9+
noratelimit Template:Int - <translate> not affected by [[<tvar|man>Special:MyLanguage/Manual:$wgRateLimits</>|rate limits]] (prior to the introduction of this right, the configuration variable <tvar|RateLimitsExcludedGroups>Template:Ll</> was used for this purpose)</translate> sysop, bureaucrat 1.13+
purge Template:Int - <translate> [[<tvar|man>Special:MyLanguage/Manual:URL</>|URL parameter]] "&action=purge"</translate> user 1.10+
suppressredirect Template:Int bot, sysop 1.12+
writeapi Template:Int *, user, bot 1.13+

Template:Note

<translate>

List of groups

The following groups are available in the latest version of MediaWiki.</translate> <translate> If you are using an older version then some of these may not be implemented. </translate>

Template:Hl2 | <translate> Group</translate> Template:Hl2 | <translate> Description</translate> Template:Hl2 | <translate> Default rights</translate> Template:Hl2 | <translate> Versions</translate>
* <translate> all users (including anonymous).</translate> createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, editmyusercss, editmyuserjs, editmywatchlist, read, viewmyprivateinfo, viewmywatchlist, writeapi 1.5+
user <translate> registered accounts.</translate> applychangetags, changetags, createpage, createtalk, edit, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, writeapi
autoconfirmed AutoConfirmAge>Template:Ll</> and having at least as many edits as <tvar|AutoConfirmCount>Template:Ll</>.</translate> autoconfirmed, editsemiprotected 1.6+
bot <translate> accounts with the bot right (intended for automated scripts).</translate> autoconfirmed, autopatrol, apihighlimits, bot, editsemiprotected, nominornewtalk, suppressredirect, writeapi 1.5+
sysop <translate> users who by default can delete and restore pages, block and unblock users, et cetera.</translate> apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, delete, deletedhistory, deletedtext, editinterface, editprotected, editsemiprotected, editusercss, edituserjs, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, move, move-categorypages, move-rootuserpages, move-subpages, movefile, noratelimit, patrol, protect, proxyunbannable, reupload, reupload-shared, rollback, suppressredirect, unblockself, undelete, unwatchedpages, upload, upload_by_url 1.5+
bureaucrat <translate> users who by default can change other users' rights.</translate> noratelimit, userrights 1.5+

<translate> From MW 1.12, you can create your own groups into which users are automatically promoted (as with autoconfirmed and emailconfirmed) using <tvar|AutoPromote>Template:Ll</>.</translate> <translate> You can even create any custom group by just assigning rights to them.

Default rights

The default rights are defined in <tvar|DefaultSettings>Template:Ll</>.</translate> <translate>

<translate>

<translate>

  • Additional rights: you should be able to list all the permissions available on your wiki by running <tvar|getAllRights>User::getAllRights()</>.

</translate>

Template:Anchor <translate>

Adding new rights

</translate> <translate> Information for coders only follows.</translate>

<translate> If you're adding a new right in core, for instance to [[<tvar|man>Special:MyLanguage/Manual:Special pages</>|control a new special page]], you are required to add it to the list of available rights in <tvar|User>Template:Ll</>, $mCoreRights ([<tvar|url>https://gerrit.wikimedia.org/r/#/c/135312/73/includes/User.php</> example]).</translate> <translate> If you're {{<tvar|man>ll|Manual:Developing extensions</>|doing so in an extension}}, you instead need to use <tvar|AvailableRights>Template:Ll</>.

You probably also want to assign it to some user group by editing <tvar|GroupPermissions>Template:Ll</> described above.

If you want this right to be accessible to external applications by <tvar|OAuth>Template:Ll</> or by [[<tvar|botpasswords>Manual:Bot passwords</>|bot passwords]], then you will need to add it to a grant by editing <tvar|GrantPermissions>Template:Ll</>.</translate>

<source lang="php"> // 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; </source>

Security

As any open-source software, the Wiki is vulnerable to external attacks:

Getting started