MediaWiki默认名称空间的编辑权限 [英] Editing permissions of MediaWiki default namespaces
问题描述
目前,我正在尝试为用户:"命名空间设置一些自定义的权限,因为不应该允许普通用户编辑或创建文章,而要设置其个人文章.因此,他们需要权限"edit"和"createpage",但我已为他们禁用了这些权限. 我尝试使用默认ID"2",您在这里找到它: 链接 并设置自己的名称空间,在我的情况下为"102".但是两个版本都无法正常工作,或者我的代码有问题吗?
At the moment I'm trying to set some custom premissions for the "user:" Namespace, because normal users shouldn't be allowed to edit or create an article but setting up their personal article. Therefore they need the rights "edit" and "createpage", which i disabled for them. I've tried the default ID "2", you find it here: Link and setting up an own namespace, in my case it was "102". But both versions didn't worked, or was something wrong with my code?
$wgGroupPermissions['user'] ['ns102_edit'] = true;
$wgGroupPermissions['user'] ['ns102_create'] = true;
还有
$wgGroupPermissions['user'] ['ns2_edit'] = true;
$wgGroupPermissions['user'] ['ns2_create'] = true;
推荐答案
If you want to restrict editing in a namespace, you should use $wgNamespaceProtection
, e.g. like this:
$wgNamespaceProtection[NS_MAIN] = $wgNamespaceProtection[NS_MEDIAWIKI] =
$wgNamespaceProtection[NS_PROJECT] = $wgNamespaceProtection[NS_FILE] =
$wgNamespaceProtection[NS_TEMPLATE] = $wgNamespaceProtection[NS_HELP] =
$wgNamespaceProtection[NS_CATEGORY] = array( 'sysop' );
这将使提到的名称空间仅对站点管理员以外的任何人可读.对话页面仍可编辑.您可能还想看看扩展名锁定.它使每个命名空间的特权更易于维护.
This will make the mentioned namespaces read only to anyone but the site admins. Talk pages are still editable. You might want to have a look at the extension Lockdown as well. It make per namespace priviligies easier to maintain.
在您的情况下,听起来像您也想使用 UserPageEditProtection 阻止用户彼此编辑用户页面.
In your case it sound to me like you also want to use UserPageEditProtection, to prevent users to edit each other user pages.
这篇关于MediaWiki默认名称空间的编辑权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!