Page MenuHomePhabricator

Configure temporary-account-viewer group to use RestrictedGroups config
Closed, ResolvedPublic

Description

Background

The temporary-account-viewer is configured to be restricted to users that meet requirements for edit count and account age: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1148827

This was done quickly, and using custom code that was not easily re-usable for other groups that might have requirements.

After T409714, a group can be configured more easily using $wgRestrictedGroups. The temporary-account-viewer group should use this config instead.

Existing config, to be removed (codesearch):

$wgCheckUserGroupRequirements = [
	'temporary-account-viewer' => [
		'edits' => 300,
		'age' => 86400 * 30 * 6,
		'exemptGroups' => [ 'steward' ],
		'reason' => 'checkuser-group-requirements-temporary-account-viewer',
	],
];

New config:

$wgRestrictedGroups['temporary-account-viewer'] = [
	'memberConditions' => [
		'&',
		[ APCOND_EDITCOUNT, 300 ],
		[ APCOND_AGE, 86400 * 30 * 6 ],
	],
	'canBeIgnored' => true,
];

Notes:

  • Instead of exemptGroups, we should set canBeIgnored true and assign ignore-restricted-groups to stewards
  • We may need to change the message key for the reason, depending on how that is handled in T409714
Acceptance criteria
  • temporary-account-viewer is configured using $wgRestrictedGroups instead of $wgCheckUserGroupRequirements
  • ignore-restricted-groups permission is assigned to stewards
  • There is no functional difference
  • It is possible to remove $wgCheckUserGroupRequirements and related code

($wgCheckUserGroupRequirements is not actually removed in this task.)

Event Timeline

Change #1206340 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/WikimediaMessages@master] Add 'userrights-restricted-group-temporary-account-viewer'

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

Change #1206340 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Add 'userrights-restricted-group-temporary-account-viewer'

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

Change #1206882 had a related patch set uploaded (by Reedy; author: Reedy):

[operations/mediawiki-config@master] CommonSettings: Swap $wgCheckUserGroupRequirements $wgRestrictedGroups

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

ignore-restricted-groups permission is assigned to stewards

I made a mistake here, by asking @Reedy to assign this to the global steward group.

As @Urbanecm_WMF pointed out, it should be assigned to the local meta steward group, along with other user-rights permissions, here in configuration.

Change #1210605 had a related patch set uploaded (by Tchanders; author: Tchanders):

[operations/mediawiki-config@master] Assign 'ignore-restricted-groups' to steward group on metawiki

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

Change #1206882 merged by jenkins-bot:

[operations/mediawiki-config@master] CommonSettings: Swap $wgCheckUserGroupRequirements for $wgRestrictedGroups

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

Change #1210605 merged by jenkins-bot:

[operations/mediawiki-config@master] Assign 'ignore-restricted-groups' to steward group on metawiki

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

Mentioned in SAL (#wikimedia-operations) [2025-11-25T14:05:01Z] <tchanders@deploy2002> Started scap sync-world: Backport for [[gerrit:1206882|CommonSettings: Swap $wgCheckUserGroupRequirements for $wgRestrictedGroups (T409717)]], [[gerrit:1210605|Assign 'ignore-restricted-groups' to steward group on metawiki (T409717)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-25T14:09:29Z] <tchanders@deploy2002> reedy, tchanders: Backport for [[gerrit:1206882|CommonSettings: Swap $wgCheckUserGroupRequirements for $wgRestrictedGroups (T409717)]], [[gerrit:1210605|Assign 'ignore-restricted-groups' to steward group on metawiki (T409717)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-25T14:15:25Z] <tchanders@deploy2002> Finished scap sync-world: Backport for [[gerrit:1206882|CommonSettings: Swap $wgCheckUserGroupRequirements for $wgRestrictedGroups (T409717)]], [[gerrit:1210605|Assign 'ignore-restricted-groups' to steward group on metawiki (T409717)]] (duration: 10m 24s)