Background
See the parent task for more details.
We need a preference which, when selected, allows the user to reveal IP addresses (T325238) when they want to.
This should be added via the CheckUser extension, since that's where all the IP address reveal functionality lives.
Acceptance criteria
About the preference:
- Checkbox, where checked means that the user can see IP address reveal buttons
- Appears under the Special:Preferences#mw-prefsection-personal tab (the default tab)
- Available to anyone with the checkuser-temporary-account right, and no-one else
Checked by default for users in the checkuser groupsee T327061: Enable temp account ip viewing preference by default for checkusers- Unchecked by default for everyone else
- Section title TBC (T327281). For now, "Temporary account IP reveal"
- Checkbox wording TBC (T327281). For now, "Enable revealing IP addresses for temporary accounts"
This task is just for adding the preference, not yet for checking it anywhere.
Notes
- Example patch where a preference was added to IPInfo: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/IPInfo/+/640236
- Documentation on the GetPreferences hook: https://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences
Testing notes
- This should be tested locally
- This should be tested with a user who has the checkuser-temporary-account right, e.g. by assigning $wgGroupPermissions['sysop']['checkuser-temporary-account'] = true; and testing with an admin account
- It should probably also be tested with a user who doesn't have that right