Help:Access Restrictions

From GRWiktionaryHelp

(Redirected from Access Restrictions)

MediaWiki Handbook: Contents | How To Use Help | Other help Software help for MediaWikiReaders, Editors, Admins e0 +/-


Configuration changes can be inserted into LocalSettings.php and must generally appear below the line:

require_once( "includes/DefaultSettings.php" );
  • In order to prevent new user registrations, the following line could be added to the LocalSettings.php file:
 $wgWhitelistAccount = array ( "sysop" => 1, "developer" => 1 );
Note: New users will still be able to be created by sysops, in the following manner:
Go to [[Special:Userlogin]], when logged in as a sysop. Enter a username and an email address, and click the "by email" button. The account will be created with a random password which is then emailed to the given address.
  • By adding the following line to LocalSettings.php, it is possible to entirely disable anonymous edits:
  #Entirely disable Anonymous Edits
  $wgWhitelistEdit = true;

In 1.5 (MediaWiki Install/includes/DefaultSettings.php):

  $wgGroupPermissions = array();
  $wgGroupPermissions['*'    ]['createaccount']   = true;
  $wgGroupPermissions['*'    ]['read']            = true;
  $wgGroupPermissions['*'    ]['edit']            = true;

Comment (#) out permissions you wish to disable for anonymous users, or add the specific lines to LocalSettings.php, setting the value = false;.

  • If you want anonymous users not to be able to read or edit your MediaWiki, add this line to your LocalSettings.php:
# Pages anonymous (not-logged-in) users may see
$wgWhitelistRead = array ("Main Page", "Special:Userlogin", "Wikipedia:Help");
This way anonymous users can only see the Main Page, the user login page and the help page.
Caution: if your MediaWiki is in a language different than English, you need to translate the titles in the array. For instance, in Spanish the line will look like this one:
 $wgWhitelistRead = array ("Portada", "Especial:Userlogin", "MiWiki:Ayuda");
You may find more information about user access restriction on Setting user rights in MediaWiki
  • To prevent a special page from being listed at [[Special:Specialpages]], edit SpecialPage.php and change the relevant entry to be an instance of UnlistedSpecialPage instead of SpecialPage.

See also: Help:User levels, m:Page access restriction with MediaWiki, and Hidden pages


Question: I want it so only registered users can edit the page itself but still allow general (anonymous) access to Discuss this page/Post a comment. Can this be done?

New Answer: Yes. See Here.

MediaWiki Handbook: Contents | Other help


Reading: Go | Search | URL | Namespace | Page name | Section | Link | Backlinks | Piped link | Interwiki link | Redirect | Variable | Category | Special page
Tracking changes: Recent | (enhanced) | Related | Watching pages | Page history | Diff | User contributions | Edit summary | Minor edit |
Logging in and preferences: Logging in | Preferences | User style
Editing: Overview | Wikitext | New page | List | Images/files | Image page | Special characters | Formula | Table | EasyTimeline | Template | Renaming / Moving a page | Editing shortcuts | Talk page | Testing | Export |

Wiki Projects: Wikibooks | Wikicommons | Wikipedia | Wikiquote | Wikisource | Wiktionary |