This page is a translated version of the page Manual:$wgNamespaceProtection and the translation is 50% complete.
アクセス権: $wgNamespaceProtection
導入されたバージョン:1.10.0 (r19110)
既定値:$wgNamespaceProtection = []; (1.14+)
$wgNamespaceProtection[NS_MEDIAWIKI] = array( 'editinterface' ); (1.10 - 1.13)


この設定は、ウィキの一部の名前空間を編集するために特別な権限を必要とすることができるようにします。 既定では、MediaWiki 名前空間は 、'editinterface ' 権限を持つ利用者 (既定では管理者) のみが編集できるよう制限がかかっています。

配列のキーは名前空間番号で、値はアクセス許可名の単純な配列です。 特定の名前空間に対して複数のアクセス許可を一覧にして表示する場合、その名前空間を編集するには利用者がすべてのアクセス許可を持っている必要があります。

Since 1.14, the MediaWiki: namespace is unconditionally protected to users with 'editinterface' right (same as in previous versions). 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. (Extension:Lockdown を参照)


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


Setting up custom namespaces with restricted write access

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; // only managers can edit pages in the Official namespace
$wgGroupPermissions['employees']['official-talk-edit'] = true; // employees can edit pages in the Official_talk namespace
$wgGroupPermissions['managers']['official-talk-edit'] = true; // so can managers


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'];