Page MenuHomePhabricator

Don't show controls when users can't add/edit statements to protected files
Closed, ResolvedPublic

Description

T221732 regressed: statement panels continue to show their edit button (and all other controls) even when we know the user will have no permissions to make changes.

Event Timeline

matthiasmullie renamed this task from Visually indicate to users that they can't add/edit statements to protected files to Don't show controls when users can't add/edit statements to protected files.Jun 18 2021, 9:03 AM

Change 700349 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/WikibaseMediaInfo@master] Don't show controls when users can't add/edit statements

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

Change 700349 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] Don't show controls when users can't add/edit statements

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

Etonkovidova added a subscriber: Etonkovidova.

Checked in betalabs - the issue is fixed. Moving to Verify on Production.

Checked on commons wmf.11.

The controls for the statements on pages with Full protection and Template protection cannot be edited by users who do not have edit rights.

However, the pages with Cascading protection can be edited by users in Users, Autoconfirmed groups.
The message "This page is currently protected, and can be edited only by administrators." incorrectly says that only Administrators can edit.

Tested for a user that is only in Users, Autoconfirmed groups

Fully protected - File:Signaturhinweis_deutsch.pngCascading protection - File:Button_link.png
Screen Shot 2021-06-24 at 3.47.32 PM.png (1×2 px, 277 KB)
Screen Shot 2021-06-24 at 3.46.38 PM.png (846×2 px, 153 KB)

@matthiasmullie - can you confirm that the above case for Cascading protection is correct? And probably the message should be changed?

The error message is actually correct & "ordinary" users can't submit their edits indeed.
Ideally, it also wouldn't show controls in that case, but at least it actually does prevent the edit (and again shows the same error message)

Sadly, this is intentional - that ahead-of-time cascading protection check was removed here because it was expensive and incomplete.

The error message is actually correct & "ordinary" users can't submit their edits indeed.
Ideally, it also wouldn't show controls in that case, but at least it actually does prevent the edit (and again shows the same error message)

Sadly, this is intentional - that ahead-of-time cascading protection check was removed here because it was expensive and incomplete.

Thanks, @matthiasmullie! Marking the task as Resolved.