Page MenuHomePhabricator

Give clarified error message when viewing &action=edit without sufficient rights
Open, Needs TriagePublic

Description

For consistency, &action=edit should give an error message corresponding to the required permission if the user doesn't have appropriate permissions.
Due to the implementation of T220779, T220810 and other related Phabricator tasks, missing action-* messages were added to match their right-* messages.
Example: For edits to system-wide CSS and JavaScript pages such as MediaWiki:common.js, the editsitecss and editsitejs rights are required (on top of the normal editinterface right, that is required for edits to the MediaWiki namespace). When a user without interface administrator permissions clicks "view source", the see this message:

You do not have permission to edit this page, for the following reasons:

The editsitejs right has its relevant interface message, action-editsitejs, with content "edit sitewide JavaScript". So the permission error message should retrieve the text of action-editsitejs, as follows:

You do not have permission to edit sitewide JavaScript, for the following reasons:

These MW-core userrights are affected:

editinterface, editprotected, editmyusercss, editmyuserjson, editmyuserjs, editmyuserjsredirect, editsemiprotected, editsitecss, editsitejson, editsitejs, editusercss, edituserjson, edituserjs

The same issue happens with lots of extensions which provide specific editing userrights.