From f979d1bfce8196b784e16c2eb02aee7549918b70 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 1 Aug 2015 00:39:52 -0700 Subject: [PATCH] registration: Allow setting $wgNamespaceProtection Change-Id: Id071eeeb3e734f7833d36610a6b4e786f2d26fa6 --- docs/extension.schema.json | 4 ++++ includes/registration/ExtensionProcessor.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/extension.schema.json b/docs/extension.schema.json index eef2c0ae14..71be7a5561 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -473,6 +473,10 @@ }, "defaultcontentmodel": { "type": "string" + }, + "protection": { + "type": ["string", "array"], + "description": "Userright(s) required to edit in this namespace" } }, "required": ["id", "constant", "name"] diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index da8600c77a..4a0843f1a9 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -62,6 +62,7 @@ class ExtensionProcessor implements Processor { 'wgExtraGenderNamespaces' => 'array_plus', 'wgNamespacesWithSubpages' => 'array_plus', 'wgNamespaceContentModels' => 'array_plus', + 'wgNamespaceProtection' => 'array_plus', ); /** @@ -223,6 +224,9 @@ class ExtensionProcessor implements Processor { if ( isset( $ns['defaultcontentmodel'] ) ) { $this->globals['wgNamespaceContentModels'][$id] = $ns['defaultcontentmodel']; } + if ( isset( $ns['protection'] ) ) { + $this->globals['wgNamespaceProtection'][$id] = $ns['protection']; + } } } } -- 2.20.1