我尝试在我的 MediaWiki 上创建一些权限。我按照本教程进行操作,但是没有用...
我尝试创建一个 Staff 组,该组有权读取、编辑、创建和删除 Staff 命名空间中的页面。经典用户不应看到此命名空间中的所有页面。
这是 LocalSettings.php 文件:
# Namespaces
define('NS_STAFF', 103);
$wgExtraNamespaces[NS_STAFF] = 'Staff';
# Groups
define('G_STAFF', 'Staff');
# Default Group Rights
# Anonyms
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['create'] = false;
# User
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['create'] = false;
# Staff
$wgGroupPermissions[G_STAFF]['read'] = true;
$wgGroupPermissions[G_STAFF]['edit'] = true;
$wgGroupPermissions[G_STAFF]['create'] = true;
# Groups Rights
$wgNamespaceProtection[NS_STAFF] = array(G_STAFF);
能解释一下我做错了什么吗?
更新
我将我的 Mediawiki 升级到版本 1.19.0。进入命名空间“Staff”的页面对于用户组仍然可见,但不可编辑。
如何阻止对特定名称空间的页面的访问?
这是 LocalSettings.php 文件:
#Groups
define('G_PROGRAMMER', 'Programmer');
define('G_ADMIN_SYSTEM', 'AdminSystem');
define('G_DESIGNER', 'Designer');
define('G_STAFF', 'Staff');
# Default Group Rights
# Anonyms
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['create'] = false;
# User
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['create'] = false;
# Staff
$wgGroupPermissions[G_STAFF]['read'] = true;
$wgGroupPermissions[G_STAFF]['edit'] = true;
$wgGroupPermissions[G_STAFF]['create'] = true;
# Groups Rights
$wgNamespaceProtection[NS_STAFF] = array('staff-edit');
$wgGroupPermissions[G_STAFF]['staff-edit'] = true;