Page MenuHomePhabricator

Special:InvestigateBlock error is confusing
Closed, ResolvedPublic

Description

As a non-admin checkuser,
When I visit Special:InvestigateBlock
I am told that the functionality is only available to checkusers

Expected result:
Told that the functionality is only available to checkusers with block rights

Actual result:
Told that it is only available to checkusers

Notes:
Caused by SpecialInvestigateBlock::userCanExecute adding a check for for block rights but relying on the default parent displayRestrictionError method

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Niharika subscribed.

@DannyS712 Thanks for creating this. I agree it's a bug and should be fixed.

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

[mediawiki/extensions/CheckUser@master] Read rights for GUI in Investigate and perm. errors in InvestigateBlock

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

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

[mediawiki/extensions/CheckUser@master] Check rights for Investigate GUI and InvestigateBlock permission errors

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

Change 800011 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Check rights for Investigate GUI and InvestigateBlock permission errors

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

@Dreamy_Jazz One side-effect of hiding the block form from Special:Investigate is that the user cannot see the usernames and IPs they are currently investigating. I think this is information the user will need to know, especially if they have multiple investigations going at the same time. Perhaps @Tchanders has an idea how this can be done.

User with block rights:

block_form_before.png (351×1 px, 25 KB)

User without block rights:

block_form_after.png (240×1 px, 19 KB)

Also bear in mind that the GuidedTour includes a step explaining the block form which obviously won't make sense if the user cannot see the block form (see below).

block_form_guidedtour.png (411×1 px, 50 KB)

I missed that the users being investigated would be hidden. Also didn't notice there was a tour for this. I probably need to use Special:Investigate more on enwiki.

I'll write a patch to fix the issue so that only the block button is hidden instead.

I'm not sure about how to modify the tour as it's a JS file that seems static. I would need to install the associated extension to test too.

I've not been able to solve an issue with regards to the tour. I can't mix the tour code and mw.user.getRights as any code inside the callback ends up not affecting the tour. Trying to use async functions doesn't get me any further towards the goal.

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

[mediawiki/extensions/CheckUser@master] Show users under investigation even without the block right

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

Discussed with Krinkle on wikimedia-tech about the issues with the guided tour. Came up with this code https://paste.toolforge.org/view/9a2bfe3e, however, this is not able to solve the issue and it seems that the guided tour extension doesn't work with anything that returns a JQuery promise.

Instead of trying an async JS call, you could have the special page output a mw.config variable like wgCheckUserHasBlockRight or something.

Change 802878 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Show users under investigation even without the block right

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

Also bear in mind that the GuidedTour includes a step explaining the block form which obviously won't make sense if the user cannot see the block form (see below).

block_form_guidedtour.png (411×1 px, 50 KB)

Thanks for spotting this. There's also a problem with the 'copywikitext' step, which should also be shown conditionally. I've filed a new follow-up: T309983

@Dreamy_Jazz Thanks for the patches - we can solve the guided tour separately in T309983, probably using @Legoktm's suggestion

How Special:Investigate now looks without block rights:

block_form_without_block_right.png (306×1 px, 29 KB)

How it looks with block rights (same as before this change):

block_form_with_block_right.png (352×1 px, 31 KB)

If you try to access Special:InvestigateBlock without block rights:

specialinvestigateblock_without_block_right.png (230×663 px, 17 KB)

If you try to access Special:InvestigateBlock without checkuser rights:

specialinvestigateblock_without_checkuser_right.png (223×788 px, 18 KB)

Also, if you don't have checkuser-log rights it will not show you the "Logs" button on the top right (which normally takes you to Special:CheckUserLog).

I tested each page of Special:Investigate with different combinations of rights (checkuser, checkuser-log and block) and checked that the basic functionality worked.

Test environment: local docker CheckUser 2.5 (3ccbacf) 20:46, 6 June 2022.

Dreamy_Jazz moved this task from General / Unsorted to Done on the CheckUser board.
Dreamy_Jazz removed a project: Patch-For-Review.

All changes to address this have been merged, so marking as resolved.