Page MenuHomeDevCentral

Merge permissions triple way
Open, Needs TriagePublic

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

dereckson created this task.Mar 6 2020, 15:35
dereckson added a subscriber: inidal.
dereckson added a comment.EditedMar 6 2020, 15:53

When done, D2270 can be simplified into:

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