Extension talk:WhitelistedNamespaces

From mediawiki.org
Latest comment: 14 years ago by Lhridley in topic Doesn't work?

Guidance on wgGroupPermissions is confusing[edit]

Thanks for creating this extension - it looks very useful.

This is confusing: In the install page you tell us to insert "$wgGroupPermissions['*']['read'] = false;" into LocalSettings.php. Then below that I see "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..." What is the right process?
Kcalmond 18:00, 25 February 2010 (UTC)Reply

You don't have to set $wgGroupPermissions['*']['read'] = false as this extension will do that for you, but there are those who like to keep all of their Group Permissions settings in one place. If that statement is confusing to you I will take a second look a the instructions and see if I can write them more clearly. --Lisa Ridley (talk) 21:06, 25 February 2010 (UTC)Reply

Doesn't work?[edit]

Now I wish I could get it to work. I'm trying it out on a clean MW 1.15 install running on RHEL. I added a namespace ("pub") and tested. When I create a page in the namespace (ie. pub:test_page) I still get the no access login error page returned by the wiki. Modifications to my LocalSettings.php were made in the order shown below. What have I missed?

## Add namespace for public access control (using WhitelistedNamespaces extension)
define("NS_PUB", 150);
define("NS_PUB_TALK", 151);
$wgExtraNamespaces[NS_PUB] = "pub";
$wgExtraNamespaces[NS_PUB_TALK] = "pub_talk";

## Use WhitelistedNamespace extension (allow anon access to all pages in a namespace)
require_once("$IP/extensions/WhitelistedNamespaces/WhitelistedNamespaces.php");

$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['create'] = false;
## Allow anonymous access to some pages...
$wgWhitelistRead=array ("Main Page","Special:UserLogin","Privacy policy","About","Disclaimers","Test Page");
## Allow anonymous users to view all pages in a specified namespace...
$wgWhitelistedNamespaces = array(NS_PUB, NS_PUB_TALK);

Kcalmond 18:00, 25 February 2010 (UTC)Reply

Note: there was a bug in the code that has been fixed; please pull the updated code from the subject page and try it again. Sorry for the confusion.
Whitelisted pages on a wiki are designed to set up read only access for anonymous visitors. They are not designed to allow visitors to edit pages. The basic assumption with whitelisted pages is that your desire is to restrict edit access to registered users, and limit read access for anonymous users to a select group of pages.
From your description of what your desired behaviour is for your setup, that is not what you're trying to do.
Read here for more info: Manual:$wgWhitelistRead This is the basic premise on which this extension operates.
If your desire is to allow anonymous users to EDIT a select group of pages, then this extension is not designed to meet your needs. You should look at configuring namespace protections instead.--Lisa Ridley (talk) 21:24, 25 February 2010 (UTC)Reply