wikimedia Lockdown with existing Namespaces

102 Views Asked by At

I'm using an Media Wiki for documentation. After I added a lot of Pages with Namespace for example INTERN:My Page or Public:My Page and want to restrict read access for this existend Namespaces.

I've found the Extension "Lockdown" and can use it for new, custom, Namespaces:

define ("NS_CUSTOM", 110);
$wgExtraNamespaces[NS_CUSTOM] = "customNamespace";

$wgNamespacePermissionLockdown[NS_CUSTOM]['*'] = array('sysop');

If I try the same Code for my existent Namespaces the old pages aren't accessable - it seems like the pages does not exist.

Is there a way to restrict the access of existing Namespaces? Can I found the Namespace ID somewhere in the Database?

2

There are 2 best solutions below

0
On

I've created a new custom Namespace

define ("NS_CUSTOM", 111);
$wgExtraNamespaces[NS_CUSTOM] = "customNamespace";
$wgNamespacePermissionLockdown[NS_CUSTOM]['*'] = array('sysop');

and changed so ROWs in page Database Table to page_namespace = 111

0
On

According to Lockdown documentation, a single line should suffice for an already existing namespace like NS_PROJECT:

$wgNamespacePermissionLockdown[NS_PROJECT]['*'] = array('sysop');

From your question and your own answer it is not clear enough what your configuration looks like (e.g. whether you are trying to lock down multiple namespaces and maybe did some errors there). However, you should not

  1. redefine existing namespaces
  2. re-use the NS_CUSTOM definition for different namespace ids (which is a variant of 1.)