Manual:$wgRestrictedGroups
| User rights, access control and monitoring: $wgRestrictedGroups | |
|---|---|
| Conditions required for assignment of user to specific groups |
|
| Introduced in version: | 1.46.0 (Gerrit change 1200077; git #bd2f4bd0) |
| Removed in version: | Still in use |
| Allowed values: | (array) |
| Default value: | [] |
| Other settings: Alphabetical | By function | |
Details
[edit]This array contains criteria that must be met when user is added to a specific group. The syntax is:
$wgRestrictedGroups[$groupName] = [
'memberConditions' => $condsArrayForMember,
'updaterConditions' => $condsArrayForPerformer,
'canBeIgnored' => $canBeIgnored,
];
Where:
$groupName– the name of the group, for which you wish to specify the restrictions, e.g.'sysop'.$condsArrayForMember– the requirements that the user must meet in order to be added to the specified group. The syntax for specifying conditions is the same as for $wgAutopromote.$condsArrayForPerformer– the requirements that the performing user must meet in order to add the other user to the specified group. The syntax for specifying conditions is the same as for $wgAutopromote.- If
$canBeIgnoredistrue, then users with(ignore-restricted-groups)right are able to bypass the restrictions set for this group (both for the performer and for the target), if the conditions are not met.
It's not needed to specify all three items of the array.
If 'memberConditions' or 'updaterConditions' are not present, they are assumed to be equal to [], which is interpreted as a condition that is always true.
If 'canBeIgnored' is not specified, the requirements are assumed to be unignorable (i.e., (ignore-restricted-groups) has no effect on adding to this group).
If the conditions are not met, next to the group checkbox on Special:UserRights, the performer will see a message coming from MediaWiki:Userrights-restricted-group-<group-name> (which falls back to MediaWiki:Userrights-restricted-group-warning, if unspecified).
The conditions defined using this variable are checked only at the time when user is added to the group. If at a later time, the user stops meeting any of them, the group will not be removed automatically.
Example
[edit]The following replicates the conditions used on the Wikimedia cluster for the Temporary account IP viewers group – normally, the account must be older than 6 months and have 300 edits, but stewards can overrule these requirements:
$wgRestrictedGroups['temporary-account-viewer'] = [
'memberConditions' => [
'&',
[ APCOND_EDITCOUNT, 300 ],
[ APCOND_AGE, 86400 * 30 * 6 ],
],
'canBeIgnored' => true,
];