registration: Allow setting $wgNamespaceProtection
authorKunal Mehta <legoktm@gmail.com>
Sat, 1 Aug 2015 07:39:52 +0000 (00:39 -0700)
committerLegoktm <legoktm.wikipedia@gmail.com>
Sun, 2 Aug 2015 20:29:44 +0000 (20:29 +0000)
Change-Id: Id071eeeb3e734f7833d36610a6b4e786f2d26fa6

docs/extension.schema.json
includes/registration/ExtensionProcessor.php

index eef2c0a..71be7a5 100644 (file)
                                        },
                                        "defaultcontentmodel": {
                                                "type": "string"
+                                       },
+                                       "protection": {
+                                               "type": ["string", "array"],
+                                               "description": "Userright(s) required to edit in this namespace"
                                        }
                                },
                                "required": ["id", "constant", "name"]
index da8600c..4a0843f 100644 (file)
@@ -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'];
+                               }
                        }
                }
        }