Pergunta

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;
Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top