Topic on Extension talk:Lockdown/Archive 2

Can't Block Special Namespace

4
121.200.34.78 (talkcontribs)

I've installed Lockdown to restrict the special namespace to sysop and cm user groups, but when testing it, it doesn't seem to work.


My LocalSettings.php contains the following:

wfLoadExtension( 'Lockdown' );

$wgNamespacePermissionLockdown[NS_SPECIAL]['*'] = [ 'sysop', 'cm' ];


Any advise? Thanks

Narcisgarcia (talkcontribs)

Same here.

Tried:

$wgNamespacePermissionLockdown[NS_SPECIAL]['*'] = [ 'user' ];

Perhaps is there some way to do a loop to every special page (from what array?) and set $wgSpecialPageLockdown for them.

Narcisgarcia (talkcontribs)

This works for me to make special pages disappear to anonymous users:

$wgHooks['SpecialPage_initList'][] = function ( &$list ) {
	$PagesWhiteList = array('Userlogin', 'PasswordReset', 'Categories', 'Tags', 'Search', 'Captcha');
	foreach ($list as $PageName => $PageSpecs) {
		if (!in_array($PageName, $PagesWhiteList) && RequestContext::getMain()->getUser()->isAnon()) {
			unset( $list[$PageName] );
		}
	}
	return true;
};
71.185.78.14 (talkcontribs)

Any fixes for this yet? I want to allow only a custom user group to certain pages. Special page lockdown works fine for pre-made user groups but not with custom.

Reply to "Can't Block Special Namespace"