Extension:InternalWhitelist
![]() | MediaWiki was not designed to support per-page or partial-page access restrictions. If you require this level of control, you are strongly advised to use a content management system that supports it natively.
Patches or third-party extensions claiming to provide access control may contain security flaws, potentially exposing confidential data. Use them at your own risk. Neither the MediaWiki developers nor the Wikimedia Foundation are responsible for any data leaks that may result. This message is added to all extensions of this nature and may not reflect the actual security status of this extension. For more information, see Security issues with authorization extensions . |
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
![]() Release status: unmaintainedCategory:Unmaintained extensions |
|
---|---|
Implementation | User rightsCategory:User rights extensions |
Description | Provides the capability to maintain a listing of "whitelisted" articles in the MediaWiki namespace |
Author(s) | Lisa Ridley, Stanislav Pika |
MediaWiki | 1.25+Category:Extensions with manual MediaWiki version |
Database changes | No |
License | GNU General Public License 2.0 |
Download | GitHub: Note: |
The InternalWhitelist extension provides the capability to maintain a listing of "whitelisted" articles in the MediaWiki namespace.
For wikis that choose to restrict pages that anonymous users can see, this extension provides the capability of maintaining the "whitelisted" pages from within the MediaWiki application in the MediaWiki namespace. For more information on "whitelisting", please see $wgWhitelistRead .
This extension will actually replace any previously applied settings for $wgWhitelistRead .
Installation & Setup / Changes to LocalSettings.php
- Download and place the file(s) in a directory called
InternalWhitelist
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'InternalWhitelist' ); $wgGroupPermissions['*']['read'] = false;
- Create a page titled "MediaWiki:Whitelist". List each page you wish to "whitelist" for anonymous users as a bulleted list. Comments can be added to the page by preceding each line that is a comment with a double slash ("//"). For example, to whitelist the Main Page, the discussion page for the Main Page, and the Recent Changes page, you would enter the following content in MediaWiki:Whitelist:
//Whitelisted pages //Subject pages * Main Page //Discussion pages * Talk:Main Page //Special Pages * Special:RecentChanges
The lines starting with "//" will be ignored, and the bulleted lines will become an array of whitelisted pages.
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Notes
If you are currently maintaining a whitelist in your LocalSettings.php script file, this listing will be discarded and replaced with the pages listed on MediaWiki:Whitelist. If you install this extension and do not create MediaWiki:Whitelist then all pages except Special:Userlogin will be unavailable to anonymous visitors.
It is not necessary to set $wgGroupPermissions['*']['read'] = false; in the LocalSettings.php file as this extension will set those permissions during the initialization process; however it is good practice to keep your Group Permissions settings in one place for ease of maintenance.
Only "//" will work properly for commented lines.
Download the extension by using git
on the command-line:
cd $IP/extensions sudo git clone https://github.com/staspika/mediawiki-internalwhitelist.git InternalWhitelist
See also
- Extension:GroupWhitelist - A similar extension that allows configuring which rights and groups are whitelisted for the pages.
- Extension:Whitelist Pages - Nearly identical extension