Page MenuHomePhabricator

HotCat task is inaccessible to non-admins: read-only checks require admin rights and the install step gives no guidance
Open, HighPublic1 Estimated Story PointsBUG REPORT

Description

All four /api/gadgets/hotcat/* endpoints are gated by the requireAuth middleware, which on production wikis requires admin rights (sysop/bureaucrat/editinterface). However, only installation actually needs that: checking whether the gadget is installed reads two public MediaWiki: pages unauthenticated, the uncategorized-articles list is a public query, and the preference check reads the user's own options with their own OAuth token. As a result, a non-admin on a production wiki gets 403s on the whole task — even though the categorization steps themselves only edit articles.

Additionally, a non-admin who reaches the install step and clicks Install just gets a raw "Failed to install" error with no explanation.

Proposed fix: - Move the three read endpoints (/status, /preference, /uncategorized) to a logged-in-only check; keep the admin gate (with its test-wiki bypass) on POST /install, which MediaWiki enforces server-side anyway.

  • In the install step, when the gadget isn't installed and the user can't install it, show a warning banner ("Administrator rights needed", suggesting they ask a wiki admin) and disable the Install button, mirroring the server's gate including the test-wiki bypass.
  • (Same patch also replaces the step's 🧩/⚡ emoji with Codex icons — cdxIconPuzzle, cdxIconDownload — per the design-token adoption.)

Details

Other Assignee
ToluAyo
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Fix: Clarify HotCat install warning for non-admin usersrepos/lpl/starterkit-v1!158toluayofix/hotcat-non-admin-access-messagemain
Fix: Let any logged-in user check HotCat statusrepos/lpl/starterkit-v1!119ngkountasfeat/hotcat-non-admin-accessmain
Customize query in GitLab

Event Timeline

ngkountas triaged this task as High priority.
ngkountas set the point value for this task to 1.

I can see the warning message now: "Administrator rights needed. Installing a gadget edits sitewide MediaWiki pages, which only administrators can do on mag.wikipedia.org. Ask one of your wiki's administrators to install HotCat, then return here to continue."

Minor thing I am wondering here is if the last sentence should be tweaked to say "Installing a gadget edits sitewide MediaWiki pages, which only administrators can do on mag.wikipedia.org. To proceed, either obtain Administrator and Interface Administrator rights on your wiki, or ask one of your wiki's administrators to install HotCat - then return here to enable it from your preferences and continue." Because right below this error message one sees an Install HotCat button, so it might not be apparent to a user what they need to do next if an administrator needs to install it first and they themselves might be the only administrator on their wiki.

Thank you @srishakatux! @ToluAyo can you please address Srishti's comment above?