Page MenuHomeDevCentral

Merge permissions triple way
Open, LowPublic

Description

Problem

If a wiki define rights for a group, that doesn't override the already defined key in 'default'.

'saasExtraGroupPermissions' => [
    'default' => [
        '*' => [
            'edit' => false,
            'createaccount' => false,
        ],
        'sysop' => [...],
    ]
    '+inidal' => [
            'read' => false,
    ]

We can't have a edit false, createaccount false, read false.

We can have the '*' defined by default ('+inidal') or all the group defined by inidal ('inidal') and so lost sysop config.

Plan

Plan to fix this issue is to actually perform a triple merge:

Wiki permissions = default MediaWiki permissions + saasDefaultExtraGroupPermissions + saasExtraGroupPermissions

That will allow us to prepare a default set MediaWiki + our own override as the base, to be override by the local wiki configuration.

Event Timeline

When done, D2270 can be simplified into:

'cosmo' => [
    '*' => [
        // Private wiki
        'read' => false,
        'edit' => false,
        'createaccount' => false,
    ],
],

(We can also use YAML object extends if the PHP configuration is transformed in YAML)