How to manage users and user rights in MediaWiki

In MediaWiki users that visit your site and perform various actions belong to one or more user groups. A group has rights/permissions that specify what the users in that group are allowed to do on the site. MediaWiki comes preconfigured with some default groups. You can change their permissions, you can create more groups and put users in groups. In this article we'll go over the basic tasks related to managing users, user groups and permissions. For some more details and screenshots you can also check out the tutorial on how to manage users, user groups and permissions in MediaWiki.

User Accounts

On an open MediaWiki site visitors can register and create accounts. This gives them some more rights as compared to unregistered users. Registered users can then be assigned to other user groups by other users with the permissions to do so, and in this way they can be allowed to do even more things.

Users can create their own accounts. To do this, after they open the site they have to click on the Create account button. The location of the button depends on the skin; with the default Vector skin it's in the upper right corner. Then they have to specify a username and a password and optionally an email address.

View and Search for Users

If you want to see a list of the registered users and find a particular user, there's a special page on the site that lists all users. To view that page go to Tools menu on the left>Special pages button>Users and rights section>User list button. This will display a list of all registered users. At the top of the page there are some options with which you can filter which users are shown.

View User Groups and Rights

To view what the currently existing user groups are an what the permissions for each group are, go to Tools menu on the left>Special pages button>Users and rights section>User group rights button. This will display a table with the groups and the corresponding rights for the groups. Each permission has a description and in brackets after it you'll see the exact name of the permission. That's the name that you have to use when you change permissions for the groups. Groups are created and permissions are changed by inserting some code in the LocalSettings.php file of your MediaWiki. We'll discuss this further down in the article.

MediaWiki comes with some default groups. The group with the fewest permissions is the one for all users, including unregistered users. On this page its labeled as all; the users group is for all registered users; the administrators group is the one with the most rights. The group bureaucrats has the exclusive right to put users in user groups; the bots group is intended for automated processes. The user account that's created during the installation of MediaWiki belongs to the administrator and bureaucrat groups, and also to the users group; as we mentioned, all registered users belong to it.

Add Users to User Groups

You can add registered users to any of the available groups, and you can also remove them from groups. By default all registered users are put in the users group which is the general group for registered users. They cannot be removed from it. A user can be in more than one group. They have all the permissions of the groups to which they belong. By default, only the users in the bureaucrat group are allowed to assign users to groups.

To configure to which groups a user belongs, go to Tools menu on the left>Special pages button>Users and rights section>User rights management link. On the page that opens type the username of the user in the text field and click on the button next to it. This will display some checkboxes corresponding to the existing groups. To put a user in a group mark its checkbox, and to remove a user from a group unmark its checkbox. Then click on the Save user groups button.

Block Users

There's a feature that you can use to block users. The blocked user can only read and view the content on the site; they cannot edit content or perform any other actions with pages. You can block both registered users (by using either the username of the user's account or an IP address), or you can also block IP addresses of unregistered users. To block users, go to Tools menu on the left>Special pages button>Users and rights section>Block user button.

On the form that opens type the username of the user or the IP address in the field IP address or username. From the Expiry option you can select for how long should the block be active. After the time expires (unless you set it to indefinite), the user will be automatically unblocked. From the Reason setting you can optionally select some of the preconfigured reasons and/or type a reason in the text field.

Under these options there are some checkboxes with which you can configure different aspects that will apply to the blocked user. You can select whether the user should be allowed to create new accounts, whether they will be allowed to send emails using the email form on the frontend of the site. You can select whether the user's personal page and the discussion page associated with it should be put on your watchlist. If you're blocking a username, you can select whether the IP addresses from which the user logs into their account should be automatically blocked too. If you're blocking an IP address you can select whether logged-in users who log in from that IP address should be allowed to edit content. The available options on this form depend on what options are enabled/disabled in the LocalSettings.php file of MediaWiki. For a detailed description of the options on the block form check the section on how to block users in the tutorial on managing users and permissions in MediaWiki.

After you configure the options don't forget to click on the button Block this user.

To unblock users, go to Tools menu>Special pages button>Users and rights section>Unblock user button. On the page that opens type the username or IP address in the corresponding field and click on the button Remove this block.

Create User Groups and Change the Permissions of Groups

Whether you want to create a new user group and assign a specific right(s) to it, or you want to change the permissions of existing groups, this is done in the same way. You have to edit the LocalSettings.php file of your MediaWiki and insert on a new line code that has the following form:

$wgGroupPermissions['group-name']['permission'] = true;

You have to replace group-name with the name of the group and permission with the actual label of the specific permission. The above code will add a permission to a group. To remove a permission you simply have to replace true with false. The name of the group can be that of an existing group or the name of a group that doesn't exist. If no such name exists then the group will be created with the specified permission assigned to it. If the name of the new group contains more than one word, separate them with hyphens or underscores. The permissions have exact names. As we mentioned, you can check them on the page on the frontend of the site that lists the groups and the permissions. The label of the permission is in brackets after the description.

When it comes to the default groups that come prepackaged with MediaWiki they have specific labels too. If you want to change the permissions of these groups, you have to use the exact label in the first pair of brackets in the code. Here are the labels for the default groups:

* - all users, including unregistered users too

user - all registered users

bot - a user group designed for automated processes

bureaucrat - the bureaucrat group that has the right to assign users to user groups

sysop - the administrator group

Let's have a quick example. With the following line inserted in LocalSettings.php:

$wgGroupPermissions['user']['importupload'] = true;

all registered users will be allowed to import pages with the Import tool that's available on the site.

For a more detailed review read the tutorial on how to manage users, user groups and permissions in MediaWiki.

Was this answer helpful?

 Print this Article

Also Read