Page MenuHomePhabricator

Ensure that checkusers and stewards do not have to check a preference for IP reveal right
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

According to the IP reveal access policy, stewards and checkusers can automatically access IP reveal:

Steward and CheckUser
Access is automatically granted to users who are members of the steward and checkuser user groups. These users are expected to treat the IP addresses consistent with the Access to nonpublic data policy.

...as opposed to other groups, who need to check a preference:

Admin
Opt-in through Special:Preferences. [...]

However, the current implementation required everyone to check a preference, e.g. from AbstractTemporaryAccountHandler:

if (
	!$this->permissionManager->userHasRight(
		$this->getAuthority()->getUser(),
		'checkuser-temporary-account'
	) ||
	!$this->userOptionsLookup->getOption(
		$this->getAuthority()->getUser(),
		'checkuser-temporary-account-enable'
	)
) {
	throw new LocalizedHttpException(
		new MessageValue( 'checkuser-rest-access-denied' ),
		403
	);
}
What needs doing

Ideally, we shouldn't check the preference for users in groups who don't need it.

Rather than checking the group, which can get complicated as some a WMF-specific (see also T356294), perhaps we could define a new right that is given to groups who do not need to check the preference.

QA Results - Local

Event Timeline

Rather than checking the group, which can get complicated as some a WMF-specific (see also T356294) ...

I would agree with this, especially as this config would need to follow any changes made to the groups that have checkuser-temporary-account.

For example, if a new user group is created that shouldn't have the preference then the developer needs to also remember to update it.

... perhaps we could define a new right that is given to groups who do not need to check the preference.

Would this right be given instead of checkuser-temporary-account or both rights be required? My thoughts:

  1. If we require the user have both rights, it would make this new right do nothing unless it was granted with checkuser-temporary-account which could be confusing if someone was changing who has access to view temporary account IPs.
  2. If they were configured such that you only have one of checkuser-temporary-account or this new right, then the rate limiting could get confusing (as there would be two rights to do the same action).
  3. A separate right makes it easier to understand which groups have the ability to skip the preference checking on-wiki by looking at Special:ListGroupRights but the extra bullet point that is added may not be desired by the community if both rights would be required (as it makes that page more complicated).

I've claimed this and moved this into the current sprint as I will write a patch that uses the approach of two separate user rights.

I went with this initially because the description for the right in Special:ListGroupRights looks odd when a group has both the checkuser-temporary-account-no-preference (name WIP and can be changed) and checkuser-temporary-account rights.

Change 995378 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] [WIP] Allow checkusers to view temp account IPs without preference

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

The patch is ready for review and feedback. As mentioned above, I chose the name as it was the first reasonable name I thought of. Happy to change it as desired.

Some other groups with checkuser permissions includes ombuds and staffs, which can use checkuser by default (c.f. stewards can only perform checkuser after assigning checkuser flag themselves locally).

Some other groups with checkuser permissions includes ombuds and staffs, which can use checkuser by default (c.f. stewards can only perform checkuser after assigning checkuser flag themselves locally).

Thanks for the comment. Assigning this ability to these groups will be done via WMF specific configuration at a later date (once temporary accounts are being deployed to production).

Change 995378 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Allow checkusers to view temp account IPs without the preference

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

Suggested QA steps:

  1. Add the following to your LocalSettings.php:
$wgGroupPermissions['sysop']['checkuser-temporary-account'] = true;
  1. Enable temporary accounts on your wiki if required.
  2. Using a temporary account, make several testing edits to a page and then note down to the name of the page for future steps
  3. Login to an account with the sysop (administrator) group but not the checkuser group
  4. Go to Special:Preferences and make sure the checkbox in the Temporary account IP reveal section is unchecked
  5. Load the history page for the page you edited in step 3 and verify that you see no Show IPs buttons next to the temporary account usernames
  6. Go back to Special:Preferences and check the checkbox in the Temporary account IP reveal section
  7. Load the history page ffor the page you edited in step 3 and verify that you see Show IPs buttons next to the temporary account usernames
  8. Click these buttons and verify that an IP address is displayed for each edit
  9. Login to an account with the checkuser group
  10. Load Special:Preferences and verify that no section with the title Temporary account IP reveal exists
  11. Load the history page for the page you edited in step 3 and verify that you see Show IPs buttons next to the temporary account usernames
  12. Click these buttons and verify that an IP address is displayed for each edit

@Dreamy_Jazz Checkusers do not have to check a preference for IP reveal right as seen in the screenshots and .webm below. This will move to Done. Thanks for all your work and the awesome steps!

Status: ✅PASS
Environment: Local: 1.42.0-alpha (0b66d1b)22:23, 6 February 2024
OS: macOS Sonoma 14.2.1
Browser: Chrome 121
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.m.wikipedia.beta.wmflabs.org/wiki/Cat#

✅AC1: https://phabricator.wikimedia.org/T356304

No Checkuser GroupUnchecked Temp RevealHistoryChecked Temp RevealHIstory w/Temp Checked
2024-02-06_15-41-05.png (933×857 px, 137 KB)
2024-02-06_15-48-24.png (98×564 px, 10 KB)
2024-02-06_15-48-48.png (783×3 px, 335 KB)
2024-02-06_15-49-33.png (95×534 px, 14 KB)
2024-02-06_15-50-14.png (876×3 px, 376 KB)

Admin account with checkuser group and sysop group

PreviousLatest Patch