0

我正在使用 Media Wiki 获取文档。例如,在我添加了很多带有命名空间的页面之后,INTERN:My Page或者Public:My Page想要限制对此存在的命名空间的读取访问权限。

我找到了扩展“锁定”,可以将它用于新的、自定义的命名空间:

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

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

如果我为现有的命名空间尝试相同的代码,则无法访问旧页面 - 页面似乎不存在。

有没有办法限制现有命名空间的访问?我可以在数据库的某处找到命名空间 ID 吗?

4

2 回答 2

2

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.)
于 2013-03-08T19:16:13.617 回答
0

我创建了一个新的自定义命名空间

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

并将page数据库表中的 ROW 更改为page_namespace = 111

于 2013-03-08T18:43:35.267 回答