Extension:Blacklist

The blacklist extension restricts access to specified pages by adding a robust blacklist option to MediaWiki.

Installation
Save the code below to blacklist.php in MediaWiki's extensions folder.

Add the following line in the LocalSettings.php file:

Example
Example: To block some special pages for normal users, but not sysops, do this. Or with a RegEx:

Rule Priority
White Lists will trump blacklists.

The system processes blacklists first then whitelists second. as a result doing something like this will result in the pages being fully accessible.

On a second note also keep in mind that these permissions will flow so just doing this won't work either as now no sysops will be able to see the pages(as they are all users too) and anonymous users will still be able to see it.

The way to make this work as you would expect, Ie: block annon/users and let the rest see it is as follows. We block everyone then add a flowing whitlist permission to access the page.

Group Inheritance / Custom Groups
The groups will actually inherit permissions. What I mean is if a user belongs to multiple groups then the rules will be processed for EACH group in a specific order and thus can seam to flow.

For example if I want to revoke access to page x to the group "users" it will flow to sysops and bureucrat as well, as those accounts are also users. The examples provided demonstrates how to override the flowing permission via the white list. This example will block users, and admin and bureaucrat because of the hierarchy but then we give access back to the sysop group via the whitelist.

NOTE The flowing of permissions is not technically a function of mediawiki and as such it is a bit of a hack. Because there is no hierarchy in mediawiki this extension uses a static list for making this logic work. As a result if a new group is added, it will promptly be ignored by this extension. To get it to work as you would expect you need to edit the extension and add your group to the $groupPower array where you want it to appear in the hierarchy. And groups below it will inherit it's permissions and it will inherit any from above itself. Though again whitelist/blacklist can be used to override this.

Code
This code has been tested on MediaWiki 1.10.

History:
 * 12 June 2001 -- Version 1.0 -- First release.