Making Mediawiki SpecialPages only viewable by admin

Mediawiki is good. The key feature what I need is its automatic categorized pages listing. This feature enables me to map(mind map) or relate my thoughts and findings at higher categorized level. But it is also a bit wide open for personal or private use by default installation. It is a well known fact that Mediawiki do not support granular permission by design. Many deployments might have shun away from this as one main reason. If you happen to search ACL extension, you will see this quote at the top of almost every extensions.

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, leading to loss of funds or one’s job.

Sure enough if something confidential, I wouldn’t post on my wiki. But still SpecialPages functions are too much exposed to anonymous visitor by default. Anyway, I found how to disable SpecialPages functionality to login user only. This makes the first step for me to adapt this wiki engine. The rest can be done by hiding at css skin level.

Here is a gist for making Mediawiki SpecialPages only viewable by admin or specified user group. Copy and paste this gist to end of LocalSettings.php. This conditional configuration technique is derived from Mediawiki Manual:Special_pages itself. You can play around with if clause for other function for conditional check or user right permission bit. For example, editinterface bit is one of the user right build in permission to Mediawiki.

  • http://socalhockeyclub.com/ ScrapperJoe

    This was a big help. Made a daunting task easy. Thanks for sharing.

  • Omar Mughrabi

    Thanks a lot for sharing this, been looking for such thing since a week.