Your use of the information on Hobbs Knowledge Base is at your own risk and I accept no responsibility for any damage caused. More info here.

How To Restrict MediaWiki Page Editing and Creation

From Hobbs Knowledge Base

Jump to: navigation, search

Summary

In order to allow only Sysops and approved users to create and modify pages etc... add the following lines to "LocalSettings.php":

// block anonymous users from anything other than reading (['read'])
// and creating new accounts (['createaccount'])
// (which are enabled by default, hence why they're not shown here)
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['createtalk'] = false;

// block normal users from everything apart from reading (['read'])
$wgGroupPermissions['user' ]['move']            = false;
$wgGroupPermissions['user' ]['edit']            = false;
$wgGroupPermissions['user' ]['createpage']      = false;
$wgGroupPermissions['user' ]['createtalk']      = false;
$wgGroupPermissions['user' ]['upload']          = false;
$wgGroupPermissions['user' ]['reupload']        = false;
$wgGroupPermissions['user' ]['reupload-shared'] = false;
$wgGroupPermissions['user' ]['minoredit']       = false;
$wgGroupPermissions['user' ]['purge']           = false; // can use ?action=purge without clicking "ok"

// explicitly allow everything that was denied above to standard
// users for everyone in the new "Approved" group
// Note that you don't need to create the "Approved" group, it
// automatically becomes available in Special:Userrights once
// it's added into LocalSettings.php as per these instructions
$wgGroupPermissions['Approved' ]['move']            = true;
$wgGroupPermissions['Approved' ]['edit']            = true;
$wgGroupPermissions['Approved' ]['createpage']      = true;
$wgGroupPermissions['Approved' ]['createtalk']      = true;
$wgGroupPermissions['Approved' ]['upload']          = true;
$wgGroupPermissions['Approved' ]['reupload']        = true;
$wgGroupPermissions['Approved' ]['reupload-shared'] = true;
$wgGroupPermissions['Approved' ]['minoredit']       = true;
$wgGroupPermissions['Approved' ]['purge']           = true; // can use ?action=purge without clicking "ok"

// do the same again, but this time for the 'sysop' group.
$wgGroupPermissions['sysop' ]['move']            = true;
$wgGroupPermissions['sysop' ]['edit']            = true;
$wgGroupPermissions['sysop' ]['createpage']      = true;
$wgGroupPermissions['sysop' ]['createtalk']      = true;
$wgGroupPermissions['sysop' ]['upload']          = true;
$wgGroupPermissions['sysop' ]['reupload']        = true;
$wgGroupPermissions['sysop' ]['reupload-shared'] = true;
$wgGroupPermissions['sysop' ]['minoredit']       = true;
$wgGroupPermissions['sysop' ]['purge']           = true; // can use ?action=purge without clicking "ok"

Image:Notepad.gif NOTE: The default settings for all of these can be found in "includes/DefaultSettings.php" in the Wiki root directory.


Image:Envelope.gif If the information on this page is either out-of-date, incorrect, or if you'd just like more information then please Contact Me.
Personal tools
Help