Extension:InternalWhitelist
If you need per-page or partial page access restrictions, you are advised to install an appropriate content management package. MediaWiki was not written to provide per-page access restrictions, and almost all hacks or patches promising to add them will likely have flaws somewhere, which could lead to exposure of confidential data. We are not responsible for anything being leaked.
For further details, see Security issues with authorisation 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. |
InternalWhitelist Release status: unmaintained |
|
---|---|
Implementation | User rights |
Description | Provides the capability to maintain a listing of "whitelisted" articles in the MediaWiki namespace |
Author(s) | Lisa Ridley, Stanislav Pika |
MediaWiki | 1.25+ |
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
edit- 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
editIf 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
edit- Extension:GroupWhitelist - A similar extension that allows configuring which rights and groups are whitelisted for the pages.
- Extension:Whitelist Pages - Nearly identical extension