Opas:$wgNamespaceProtection

From mediawiki.org
This page is a translated version of the page Manual:$wgNamespaceProtection and the translation is 57% complete.
Access: $wgNamespaceProtection
Kuka voi muokata mitäkin nimiavaruutta?
Introduced in version:1.10.0 (r19110)
Removed in version:still in use
Allowed values:(array of arrays)
Default value:$wgNamespaceProtection = []; (1.14+)
$wgNamespaceProtection[NS_MEDIAWIKI] = array( 'editinterface' ); (1.10 - 1.13)

Tiedot

Tämän asetuksen avulla wiki voi vaatia erityisiä käyttöoikeuksia joidenkin nimiavaruuksien muokkaamiseen. Oletuksena on aina rajoitus, että MediaWiki-nimiavaruutta voivat muokata vain käyttäjät, joilla on oikeus 'editinterface ' (oletuksena ylläpitäjät).

The keys of the array are namespace numbers, and the values are simple arrays of permission names. Jos listaat useamman kuin yhden käyttöoikeuden tietylle nimiavaruudelle, käyttäjällä on oltava kaikki oikeudet muokatakseen kyseisen nimiavaruuden sivuja.

Versiosta 1.14 lähtien nimiavaruus MediaWiki on ehdoitta suojattu vain käyttäjille, joilla on oikeus 'editinterface' (sama kuin edellisissä versioissa). This is set in Setup.php and cannot be modified in LocalSettings.php since otherwise it's too easy to set it incorrectly and leave the wiki insecure. If you want to allow other groups than sysops to edit the MediaWiki: namespace, then grant the 'editinterface' right to those groups.

It's not possible to restrict read access to a certain namespace with $wgNamespaceProtection. (Katso Laajennus:Lockdown )

Esimerkki

Päänimiavaruuden muokkaamisen rajoittaminen

$wgNamespaceProtection[NS_MAIN] = ['edit-main'];

Tämä rajoittaa päänimiavaruuden muokkaamisen ryhmään, jossa on päämuokkausoikeus.

Mukautettujen nimiavaruuksien määrittäminen rajoitetulla kirjoitusoikeudella

define("NS_OFFICIAL", 100);
define("NS_OFFICIAL_TALK", 101);

$wgExtraNamespaces = [
    NS_OFFICIAL => "Official",
    NS_OFFICIAL_TALK => "Official_talk"
];

$wgNamespaceProtection[NS_OFFICIAL]      = ['official-edit'];
$wgNamespaceProtection[NS_OFFICIAL_TALK] = ['official-talk-edit'];

$wgGroupPermissions['managers']['official-edit'] = true; // vain managerit voivat muokata sivuja virallisessa nimiavaruudessa
$wgGroupPermissions['employees']['official-talk-edit'] = true; // employees can edit pages in the Official_talk namespace
$wgGroupPermissions['managers']['official-talk-edit'] = true; // so can managers

Keskustelusivujen poistaminen käytöstä

Since "everyone" is not a core permission, literally everyone gets denied access (including sysops). Note that you'll still need to remove the tab through other methods (see: Manual:FAQ#How do I add/remove tabs throughout my wiki? )

# Disable all core TALK namespaces
$wgNamespaceProtection[NS_TALK] = ['everyone'];
$wgNamespaceProtection[NS_USER_TALK] = ['everyone'];
$wgNamespaceProtection[NS_PROJECT_TALK] = ['everyone'];
$wgNamespaceProtection[NS_FILE_TALK] = ['everyone'];
$wgNamespaceProtection[NS_MEDIAWIKI_TALK] = ['everyone'];
$wgNamespaceProtection[NS_TEMPLATE_TALK] = ['everyone'];
$wgNamespaceProtection[NS_HELP_TALK] = ['everyone'];
$wgNamespaceProtection[NS_CATEGORY_TALK] = ['everyone'];

Katso myös