Page MenuHomePhabricator

AbuseFilter protected variables: Customise error messages when user lacks access to specific protected variable
Closed, ResolvedPublic

Description

Summary

In T387331: Provide a mechanism for other extensions to modify protected variables access requirements, the associated mechanism was added. We should now customise the warning and errors messages in AbuseFilter to ensure that they make sense when a user lacks ability to see a specific set of protected variables

Background

  • T387331 added the ability for other extensions to set additional restrictions for specific protected variables
    • This was done so that CheckUser could define additional restrictions for user_unnamed_ip
  • When implementing this feature, it was decided to split off customising the error messages into a new task to break down the work

Acceptance criteria

  • When a user lacks access to a specific protected variable, the warning or error messages displayed indicate the specific variable and why this is the case

Event Timeline

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

[mediawiki/extensions/AbuseFilter@master] [Very WIP] Customise protected vars access errors for var specific restrictions

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

Change #1130146 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Customise protected vars access errors for var specific restrictions

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

For QA I would suggest:

  1. Use a wiki with CheckUser installed
  2. Create a filter with user_unnamed_ip as a variable in the conditions
  3. Trigger the filter created in step 2 a few times
  4. Attempt to access the filter and associated logs created in step 3 using accounts that do not have access. Specifically:
    1. An account which has the needed rights but is sitewide blocked
    2. An account which lacks the checkuser-temporary-account right (i.e. has neither the "Temporary account viewer" or "CheckUser" group)
    3. An account whcih has the checkuser-temporary-account right but has not checked the IP reveal preference in Special:Preferences
    4. An account which lacks access to the abusefilter-access-protected-vars right

You should expect to see error messages that indicate why the user lacks access to the protected filter or associated log(s)

dom_walden subscribed.
  1. Attempt to access the filter and associated logs created in step 3 using accounts that do not have access. Specifically:

A. An account which has the needed rights but is sitewide blocked

Looking at the filter: You may not view the details of this filter because it uses protected variables and is hidden from public view.

Looking at a log: You do not have permission to see details of this entry.

B. An account which lacks the checkuser-temporary-account right (i.e. has neither the "Temporary account viewer" or "CheckUser" group)

Filter: You may not view the details of this filter because you do not have permission to view IP addresses used by temporary accounts.

Log: You may not view this log because you do not have permission to view IP addresses used by temporary accounts.

C. An account whcih has the checkuser-temporary-account right but has not checked the IP reveal preference in Special:Preferences

Filter:

You may not view the details of this filter because it uses protected variables and is hidden from public view.

To view IP addresses for temporary accounts, please accept the agreement in your preferences.

Log:

You may not view this log because it uses protected variables and is hidden from public view.

To view IP addresses for temporary accounts, please accept the agreement in your preferences.

D. An account which lacks access to the abusefilter-access-protected-vars right

Filter: You may not view the details of this filter because you do not have permission to view and create filters that use protected variables.

Log: You do not have permission to see details of this entry.