Editing permissions of MediaWiki default namespaces

戏子无情 提交于 2019-12-12 06:32:45

问题


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;

And

$wgGroupPermissions['user'] ['ns2_edit'] = true;
$wgGroupPermissions['user'] ['ns2_create'] = true;

回答1:


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.

In your case it sound to me like you also want to use UserPageEditProtection, to prevent users to edit each other user pages.



来源:https://stackoverflow.com/questions/22285394/editing-permissions-of-mediawiki-default-namespaces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!