Page MenuHomePhabricator

Write a global function to help assign rights to a user group
Closed, DeclinedPublic

Description

I have a idea. At present people are assigning permissions to a user group, like:

$wgGroupPermissions['sysop']['interwiki'] = true;
$wgGroupPermissions['sysop']['flow-create-board'] = true;
$wgGroupPermissions['sysop']['bigdelete'] = true;

If we write a help function to help assign rights, like:

$rights = ['interwiki', 'bigdelete', 'flow-create-board'];
wfNewFun( 'sysop', $rights );

This can improve the readability of LocalSettings.php and reduce the cost of maintenance.

Event Timeline

Change 431506 had a related patch set uploaded (by 星耀晨曦; owner: RazeSoldier):
[mediawiki/core@master] Create a global function to help assign rights to a user group

https://gerrit.wikimedia.org/r/431506

Vvjjkkii renamed this task from Write a global function to help assign rights to a user group to zidaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii removed RazeSoldier as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
RazeSoldier renamed this task from zidaaaaaaa to Write a global function to help assign rights to a user group.Jul 1 2018, 8:44 AM
RazeSoldier claimed this task.
RazeSoldier lowered the priority of this task from High to Medium.
RazeSoldier updated the task description. (Show Details)
RazeSoldier edited subscribers, added: GerritBot, Aklapper; removed: RazeSoldier.
Ammarpad subscribed.

I think this is really a good idea and I have been thinking of how to reduce the amount of these permission assignment lines. Not sure if there's downside though. Adding core team for review

RazeSoldier claimed this task.
RazeSoldier subscribed.

The patch need someone to review :)

Change 431506 abandoned by 星耀晨曦:

[mediawiki/core@master] Create a global function to help assign permissions to a user group

Reason:

https://gerrit.wikimedia.org/r/431506

RazeSoldier removed RazeSoldier as the assignee of this task.