Managing user rights

From Cosmin's Wiki

Jump to: navigation, search

This page is about rights within MediaWiki. Beyond that, there is the right to edit the php files, and the right to directly access the database.


Granting rights to users

There is a simple interface (Special:Userrights) for granting a specific username 'sysop' status or (in MediaWiki 1.11) granting and revoking membership to groups with all associated user rights - a user with 'Bureaucrat' status can enter a username into this form to do this.

Older versions of MediaWiki (prior to 1.5) do not have a general interface for setting the user rights field of user accounts (use Special:Makesysop instead).

In MediaWiki versions before 1.11 assigning accounts status other than 'sysop' (including removing 'sysop' status) has to be done manually by issuing an SQL query in the database. Usually you'll want to do something like this (if you're using 1.4 or higher, see below):

> mysql -u root -p

mysql> use wikidb;

mysql> UPDATE user SET user_rights='bureaucrat,sysop' WHERE user_name='The Username';

The "user" in the above text is the user table in the wikidb database.

The user_rights field is actually a comma-separated list; presently four values are recognized by the software:

The Username is the person you want to give sysop rights.

Note that you probably need to log out and log back in for the rights information to be properly updated.

If you are using 1.4: The user_rights field has been removed and the user rights are now located in their own table. The new table is user_rights. It contains two fields; ur_user and ur_rights. This sql query should do the trick.

UPDATE user_rights SET ur_rights="bureaucrat,sysop" WHERE ur_user=1;

You may need to replace the number 1 with the appropriate user id. The user will need to log out and log back in before that user's rights will be in effect.

If you are using 1.5: The user rights are in a new table called user_groups with two fields called ug_user and ug_group. There must be one row inserted for each user right. You must know the user id number of the user from the "user" table. This sql query should do the trick. In the example below substitute 1 with the user ID number from the user table.

INSERT INTO user_groups (ug_user, ug_group) VALUES ('1', 'bureaucrat'); 
INSERT INTO user_groups (ug_user, ug_group) VALUES ('1', 'sysop');

Using phpMyAdmin

If you do not have raw access to mySQL, you can update a user's privileges via phpMyAdmin. First open phpMyAdmin, and from the left-hand frame, choose your wiki's database from the drop-down box. In the right-hand frame, a page will load listing all of the tables in the DB. At top of that page in the right-hand frame, click on the "SQL" tab. You should now see a text-box. Enter the appropriate query in to the box.

For example, if you are trying to give a user Bureaucrat & Sysop privileges in 1.4, you would enter:

UPDATE user_rights SET ur_rights="bureaucrat,sysop" WHERE ur_user=1;

... replacing, of course, the "1" in "ur_user=1" with the user's ID. (You can find this by clicking on the link in the left-hand frame which says "user." Then click the "Browse" tab and find the user's name. The ID will be on the left.)

Then push "GO". If you don't see an "error" message, then it worked.

In newer versions you have to enter (see above)

INSERT INTO user_groups (ug_user, ug_group) VALUES ('1', 'bureaucrat'); 
INSERT INTO user_groups (ug_user, ug_group) VALUES ('1', 'sysop');

The main point to remember is NOT to use things like:

> mysql -u root -p

mysql> use wikidb; 

in phpMyAdmin.

User rights levels


A user marked as 'sysop' can delete and undelete pages, protect and unprotect pages, block and unblock IPs, issue read-only SQL queries to the database, and use a shortcut revert-to-previous-contributor's-revision feature in contribs. See Help:Administration for details. (Due to something of a historical accident, users with sysop status are generally referred to as 'administrators' or 'admins' on the English Wikipedia, and most likely elsewhere.)


This is obsolete and removed from later versions of the software.

Developer has special rights and sees additional features in the Special-Pages (lock / unlock DB) as well in setting User-rights. Only a developer can UN-Set (delete) the Sysop-Rights of an admin.


This is a user that is allowed to turn other users into sysops via the aforementioned Userrights page.


A registered bot account. Edits by an account with this set will not appear by default in Recent changes; this is intended for mass imports of data without flooding human edits from view. (To show bot edits, either click the "Show bots" link on the Recentchanges page, or append &hidebots=0 directly to the page URL, e.g. like this on Wikipedia

Revoking user's privileges

Attention! In versions after MediaWiki 1.4, the table user_rights is gone, instead using table user_groups ! see maintenance/tables.sql

In its current development stage, MediaWiki has a web-based interface to create users and make sysops and bureaucrats, but it has no interface for revoking privileges.

Currently, the only way to downgrade user's privileges is through SQL:

UPDATE user SET user_rights='' WHERE user_name='yourusername';

Version 1.4 Mediawiki:

UPDATE user_rights SET ur_rights="" WHERE ur_user=1;

or using Program phpMyAdmin read a textfile into the "TINYBLOB" ur_rights or table user_rights that contains the proper user-entries "sysop,bureaucrat,developer"

Configuring access restrictions to your wiki

User rights are specific access and ability permissions that can be assigned to customizable groups, which can then be assigned to (or removed from) users through the Special:Userrights interface. The default bureaucrat user rights group enables the use of the User rights interface.

This feature was introduced in MediaWiki 1.5; see setting user rights in MediaWiki on the Meta-wiki for earlier methods.

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
read allows viewing pages (when set to false, override for specific pages with $wgWhitelistRead).

Warning:Setting this to false will only protect pages in the wiki. Uploaded files will remain readable via direct access (e.g. $wgUploadPath/imageHashes/image.jpg). Make your upload directory name unguessable, and use .htaccess (disable directory listing) to protect it.

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. 1.5+
createaccount allows the creation of new user accounts. 1.5+
upload allows the creation of new images and files. 1.5+
reupload allows overwriting existing images and files. 1.6+
reupload-shared allows replacing images and files from a shared repository (if one is set up) with local files. 1.6+
upload_by_url allows uploading by entering the URL of an external image. 1.8+
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.
bigdelete allows deletion of pages with larger than $wgDeleteRevisionsLimit revisions 1.12+
deletedhistory allows viewing deleted revisions, but not restoring. 1.6+
undelete allows the undeletion of pages. 1.12+
mergehistory allows access to Special:MergeHistory, to merge non-overlapping pages.
Note: currently disabled by default, including on Wikimedia projects.
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+
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.
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 m:Help:Administration#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 user's own monobook.css, monobook.js, ... subpages. 1.12+
hiderevision allows preventing deleted revision information from being viewed by sysops and prevents sysops from undeleting the hidden info. (not available by default, experimental) 1.6+
deleterevision allows deleting/undeleting information (revision text, edit summary, user who made the edit) of specific revisions (not available by default, experimental) 1.6+
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+
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+
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+
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+

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+
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.

Default rights

The default rights are defined in DefaultSettings.php. MediaWiki 1.13alpha defines the following:

 * 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();
// Implicit group for all visitors
$wgGroupPermissions['*'    ]['createaccount']    = true;
$wgGroupPermissions['*'    ]['read']             = true;
$wgGroupPermissions['*'    ]['edit']             = true;
$wgGroupPermissions['*'    ]['createpage']       = true;
$wgGroupPermissions['*'    ]['createtalk']       = true;
// Implicit group for all logged-in accounts
$wgGroupPermissions['user' ]['move']             = true;
$wgGroupPermissions['user' ]['read']             = true;
$wgGroupPermissions['user' ]['edit']             = true;
$wgGroupPermissions['user' ]['createpage']       = true;
$wgGroupPermissions['user' ]['createtalk']       = 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"
// Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;
// Implicit group for accounts with confirmed email addresses
// This has little use when email address confirmation is off
$wgGroupPermissions['emailconfirmed']['emailconfirmed'] = 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'  ]['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']['undelete']         = true;
$wgGroupPermissions['sysop']['editinterface']    = true;
$wgGroupPermissions['sysop']['editusercssjs']    = true;
$wgGroupPermissions['sysop']['import']           = true;
$wgGroupPermissions['sysop']['importupload']     = true;
$wgGroupPermissions['sysop']['move']             = true;
$wgGroupPermissions['sysop']['patrol']           = true;
$wgGroupPermissions['sysop']['autopatrol']       = true;
$wgGroupPermissions['sysop']['protect']          = true;
$wgGroupPermissions['sysop']['proxyunbannable']  = true;
$wgGroupPermissions['sysop']['rollback']         = true;
$wgGroupPermissions['sysop']['trackback']        = 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']['suppressredirect'] = true;
$wgGroupPermissions['sysop']['apihighlimits']    = true;
$wgGroupPermissions['sysop']['browsearchive']    = true;
#$wgGroupPermissions['sysop']['mergehistory']     = true;
// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights']  = true;
// Permission to change users' groups assignments across wikis
#$wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true;
// Experimental permissions, not ready for production use
//$wgGroupPermissions['sysop']['deleterevision'] = true;
//$wgGroupPermissions['bureaucrat']['hiderevision'] = 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;