From T381052: Investigate: Should we remove the preference check from AbuseFilter's protected variables implementation?, if we need to gate a variable behind a preference check, we should implement the functionality/feature to do so instead of hardcoding a generic preference (see T380920: Remove the AbuseFilter protected variables preference gate). user_unnamed_ip is already protected (filters using it are restricted to users w/the right to view/use protected variables) but requires the following additional restrictions:
- users should have agreed to the temp users preference/ToS
- users should have the checkuser-temporary-account right
These are variable/temp account specific and therefore probably shouldn't be implemented in the core AbuseFilter extension. We'll need a method/hook/config/etc to declare and apply these restrictions/checks.
Given how tied into temporary accounts user_unnamed_ip is, it may also be necessary to reconsider if the variable should remain a core-provided variable or if it should instead be a custom variable created by CheckUser.
Acceptance criteria:
- a method to add additional restrictions for variables exists in AbuseFilter T387331: Provide a mechanism for other extensions to modify protected variables access requirements
- user_unnamed_ip is restricted via this feature with the above restrictions T387333: CheckUser should impose IP viewing restrictions on AbuseFilter's `unnamed_user_ip` protected variable
- user_unnamed_ip is declared by the appropriate extension (no change)