Page MenuHomePhabricator

Replace "The action you have requested is limited to users in the group 'Users'" with "Please login to perform this action".
Closed, ResolvedPublic

Description

Much clearer.

Details

Event Timeline

Change #1222751 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/core@master] Clean up some edge cases in displaying permission errors

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

I like this change, but this area has been unchanged for such a long time, I think changing it requires some justification:

So, we only display "The action you have requested is limited to users in the group: Users." for actions other than 'read', 'edit', 'createpage', 'createtalk', and 'upload' [*]. I was curious why. This hardcoded list was introduced in rSVN102112/3801a3cd288f01694e9953bd5fdc070e561078f7 (https://static-codereview.wikimedia.org/MediaWiki/102112.html), which doesn't provide any explanation; it looks like these are just the actions that previously had custom error messages, and the error handling was consolidated in that commit while keeping the messages unchanged.

[*] There are also some actions that require the user to be logged in regardless of configured permissions, like 'sendemail'; and some actions that have custom error messages defined elsewhere, like 'move'.

The change makes intuitive sense for me, but I reviewed some of the permission configuration on Wikimedia wikis to look for interesting edge cases, and gain some more confidence that this is the right change to make (after all it's been like this for 15 years). Here are some examples of messages that will or won't be affected: [view each page while logged out to test]

PageCurrent error messageExpected error message after the change
https://en.wikipedia.org/wiki/Special:Upload(custom error message) You must be logged in to upload files…(unchanged)
https://en.wikipedia.org/wiki/Special:MovePage/Foo(custom error message) You must be a registered user and logged in to move a page…(unchanged)
https://en.wikipedia.org/wiki/Special:EmailUser/Matma_Rex(redirects to the login form)(unchanged)
https://en.wikipedia.org/wiki/Special:BlockThe action you have requested is limited to users in the group: Administrators.(unchanged)
https://en.wikipedia.org/wiki/Special:InvestigateThe action you have requested is limited to users in the group: Checkusers.(unchanged)
https://en.wikipedia.org/wiki/Special:EditTagsThe action you have requested is limited to users in one of the groups: Bots, Administrators, Edit filter managers.(unchanged)
https://www.mediawiki.org/wiki/Special:EditTagsThe action you have requested is limited to users in the group: Users.You need to log in to add and remove arbitrary tags on individual revisions and log entries.
https://en.wikibooks.org/wiki/Special:AbuseLogThe action you have requested is limited to users in one of the groups: Autoconfirmed users, Confirmed users.You need to log in to view the filter log.
https://www.mediawiki.org/wiki/Special:EnableStructuredDiscussionsThe action you have requested is limited to users in one of the groups: Users, Structured Discussions bots.You need to log in to create Structured Discussions boards in any location.
https://test.wikipedia.org/wiki/Special:PageLanguageThe action you have requested is limited to users in one of the groups: Users, Administrators, Translation administrators.You need to log in to change the page language.

These make sense to me (and we should verify once the change is deployed that it actually works that way).

Another thing to consider: if we ever fix T17484: Redirect to Special:UserLogin when logging is in required to proceed, instead of showing an error message and redirect to the login form instead of showing a "please log in" message, that behavior would probably apply to all of the pages affected here. I think that would probably make sense, but this change doesn't prevent us from making that only affect selected actions, if we choose to.

One last thing, I noticed that https://nostalgia.wikipedia.org/w/index.php?title=Wikipedia&action=edit displays the message "The action you have requested is limited to users in the group: Users.", even though the 'edit' action is already supposed to have special handling. This is because EditPage uses OutputPage::formatPermissionStatus() directly instead of showPermissionStatus(), and bypasses the special case. I wonder if this is a bug.

Change #1222751 merged by jenkins-bot:

[mediawiki/core@master] Clean up some edge cases in displaying permission errors

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

matmarex assigned this task to Pppery.