Page MenuHomePhabricator

Allow non-admins to use Nuke's page listing feature
Closed, ResolvedPublic

Description

At the time of writing non-admins are not permitted to open Special:Nuke at all:

Screenshot 2024-10-03 at 13.03.58.png (316×1 px, 45 KB)

There's no strong reason, however, to not allow non-admins to list pages created by a specific user or matching a title pattern. This isn't private information, and they could gather such a list elsewhere (e.g. the page creation log).

With the introduction of additional information to the page list (T370974), however, this would be a useful venue for non-admins to be able to browse data about pages created by a given user. We would simply not give them the ability to actually select or delete those listed pages.

Event Timeline

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

If we moved to a one-page system with a 'Continue' button to go ahead with actually deleting, this would be easier to implement, I think, because we can just not show the Continue button (or grey it out or somesuch).

Change #1116493 had a related patch set uploaded (by MolecularPilot; author: MolecularPilot):

[mediawiki/extensions/Nuke@master] Allow non-admin users to list pages in Special:Nuke without deletion rights

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

MolecularPilot changed the task status from Open to In Progress.Feb 2 2025, 7:40 AM
MolecularPilot claimed this task.

Special:Contributions already allows filtering specifically to new pages. I do not see why Nuke, an admin-only tool, should be extended to support non-admins in this way.

If filtering like this is desirable to support, it should be added to Special:Contributions instead.

Special:Contributions already allows filtering specifically to new pages. I do not see why Nuke, an admin-only tool, should be extended to support non-admins in this way.

If filtering like this is desirable to support, it should be added to Special:Contributions instead.

The intention here is that a non-admin can evaluate which pages Nuke is able to delete at any given moment. Given the (currently 90 day) window for page deletions, it might be less obvious to someone unfamiliar with Nuke's inner workings which pages can be deleted, if they were looking at Special:Contributions. Anyway this change primarily, as I understand it, would just move the admin check one page onwards in Nuke, and remove some checkboxes/buttons from the first form if you're not an admin, so it's not a substantial extension of functionality.

@Samwalton9-WMF, I have a question about the acceptance criteria. Should we let users who are blocked access this view, or should we let only non-admin, non-blocked users access it?

Test wiki created on Patch demo by SCardenas (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/d3ff56d02d/w/

@Samwalton9-WMF, I have a question about the acceptance criteria. Should we let users who are blocked access this view, or should we let only non-admin, non-blocked users access it?

I don't see a clear reason to hide this from blocked users.

Same! @Scardenasmolinar currently in the code, if you are blocked you can see nuke and use it to query BUT if you a blocked admin and your block applies to the delete right, you can't continue to the delete screen (both blocked and unblocked non-admins can't continue to this screen).

I support this task since it may be useful for non-admins to see a list of pages that can potentially be nominated to AfD.

Same! @Scardenasmolinar currently in the code, if you are blocked you can see nuke and use it to query BUT if you a blocked admin and your block applies to the delete right, you can't continue to the delete screen (both blocked and unblocked non-admins can't continue to this screen).

I have just tested this on the Patch Demo I created by adding user Alice as an admin and then blocking them. When I try to access Special:Nuke, I get the blocked page instead of the expected Nuke page.

Screenshot 2025-02-04 at 20.03.29.png (414×1 px, 68 KB)

@Scardenasmolinar, sorry for this mistake! I have now fixed the issue in the latest patchset I've just uploaded, it was a tiny typo in just 1 line! I've made the code a LOT more readable now to prevent things like this (including not just determining access as true/false but providing the exact reason they don't have/have access) and also implemented new tests to prevent regression of this block bug.

I don't think Patch Demo has updated as the person who made that instance needs to delete it and re-make it. :)

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

http://patchdemo.wmcloud.org/wikis/d3ff56d02d/w/

Test wiki created on Patch demo by SCardenas (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/de31b8b688/w/

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

http://patchdemo.wmcloud.org/wikis/de31b8b688/w/

Did all requested changes! Thank you so much @Scardenasmolinar for all your time in providing feedback to all of my patches!! :)

Did all requested changes! Thank you so much @Scardenasmolinar for all your time in providing feedback to all of my patches!! :)

Thank you for all the work and effort you have put into your two patches! 😄

Change #1116493 merged by jenkins-bot:

[mediawiki/extensions/Nuke@master] Allow non-admin users to list pages in Special:Nuke without deletion rights

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

jsn.sherman subscribed.

Verified behavior on testwiki; will leave open until deployed to all groups.

Confirmed this is working on enwiki, though I did find one oddity. When logged out and listing pages I noticed that the page starts off at a small font size:

Screenshot 2025-02-13 at 13.35.40.png (1×3 px, 472 KB)

And then when you list pages, the font size increases:

Screenshot 2025-02-13 at 13.36.04.png (1×3 px, 491 KB)

For Tech News, something like:

Non-administrators can now check which pages are able to be deleted using the Nuke tool, which allows administrators to mass delete pages.

Hmm... thank you for the pick up, I'm not quite sure what can be causing this but I'll investigate. :)

Confirmed this is working on enwiki, though I did find one oddity. When logged out and listing pages I noticed that the page starts off at a small font size:

Screenshot 2025-02-13 at 13.35.40.png (1×3 px, 472 KB)

And then when you list pages, the font size increases:

Screenshot 2025-02-13 at 13.36.04.png (1×3 px, 491 KB)

Likely a consequence of T366334, which forces a smaller font size for specific namespaces and actions. Nuke turns the action into list, confirm, and delete as you progress through the form, which isn't excluded from font size preferences in the current prod configuration. The way that the Vector is written right now, it will always return early with a check if the action matches a list defined in the config (which doesn't include the extra three actions) without checking the namespace (where it would have correctly excluded the page since it's in the Special namespace). So the font options end up appearing whenever the action is anything but blank (i.e. just the prompt form).