registration: Add support for $wgGrantPermissions & $wgGrantPermissionGroups
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 10 Jun 2016 20:10:27 +0000 (13:10 -0700)
committerGergő Tisza <gtisza@wikimedia.org>
Mon, 20 Jun 2016 20:45:51 +0000 (20:45 +0000)
Change-Id: If336aa351ee5dc4dc07f63cfac2a5d236e501718

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

index 1d2b2f0..1fccf17 100644 (file)
                                }
                        }
                },
+               "GrantPermissions": {
+                       "type": "object",
+                       "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
+                       "patternProperties": {
+                               "^[a-z]+$": {
+                                       "type": "object",
+                                       "patternProperties": {
+                                               "^[a-z]+$": {
+                                                       "type": "boolean"
+                                               }
+                                       }
+                               }
+                       }
+               },
+               "GrantPermissionGroups": {
+                       "type": "object",
+                       "description": "Map of grants to their UI grouping",
+                       "patternProperties": {
+                               "^[a-z]+$": {
+                                       "type": "string"
+                               }
+                       }
+               },
                "ImplicitGroups": {
                        "type": "array",
                        "description": "Implicit groups"
index 78f9370..2205f95 100644 (file)
@@ -15,6 +15,8 @@ class ExtensionProcessor implements Processor {
                'HiddenPrefs',
                'GroupPermissions',
                'RevokePermissions',
+               'GrantPermissions',
+               'GrantPermissionGroups',
                'ImplicitGroups',
                'GroupsAddToSelf',
                'GroupsRemoveFromSelf',
@@ -61,6 +63,7 @@ class ExtensionProcessor implements Processor {
        protected static $mergeStrategies = [
                'wgGroupPermissions' => 'array_plus_2d',
                'wgRevokePermissions' => 'array_plus_2d',
+               'wgGrantPermissions' => 'array_plus_2d',
                'wgHooks' => 'array_merge_recursive',
                'wgExtensionCredits' => 'array_merge_recursive',
                'wgExtraGenderNamespaces' => 'array_plus',