Page MenuHomePhabricator

CentralNotice banner page lets people without permissions visually modify stuff
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

Various things are still editable:

  • The "translatable banner messages" dropdown (or maybe this is to view stuff, I can't tell)
  • The priority languages multiselect
  • The "Insert: close button" link is still functional and modifies the otherwise uneditable big textbox

What should have happened instead?:

The entire page is uneditable if you can't edit it.

Also:

Since you know in advance that only people who can edit the page can preview, the dysfunctional "Live preview" box should be hidden. And the pointless "you aren't authorized to preview" alert can go with it too.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Since you know in advance that only people who can edit the page can preview, the dysfunctional "Live preview" box should be hidden. And the pointless "you aren't authorized to preview" alert can go with it too.

Ideally the preview should just work for non-CN-admins, would make it much easier for them to check if a banner is correct (no need for onwiki preview)

Change #1268090 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/CentralNotice@master] Check edit permission for insert close button and translatable form UI

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

aude subscribed.

I submitted a patch (in volunteer capacity) to fix the issue with having editable fields visible on Special:CentralNoticeBanners/edit for users who do not have edit permissions.

To have preview work for users who do not have centralnotice-admin rights, I created another task:

https://phabricator.wikimedia.org/T422366

I've run into this today, after running into the T248217 problem.

So we disable the editing completely, only to file T422366 to restore the preview?

This is strange.

It is also extremely frustrating to figure out what is going on. Maybe the JavaScript popup could refer the user to one of those Phabricator tickets?

It took me some time, JavaScript debugger, git checkout of the CentralNotice extension, some git grep for the error message to figure out we have a problem somewhere here in those at least 4 phabricator tickets.

Change #1268090 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Check edit permission for insert close button and banner translation UI

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

Change #1281989 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/CentralNotice@master] Disable banner-body textarea for non-CNadmins

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

Change #1281989 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Disable banner-body textarea for users without banner edit permission

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

This was fixed at the hackathon in Milan, with a [ Preview on wiki ] link (done in T422366) for non-CentralNotice admins to preview the banners.