Page MenuHomePhabricator

Bug: Section edit links should be hidden for blocked users
Closed, ResolvedPublic3 Estimated Story Points

Description

When I login as a blocked user I see edit icons that invite me to edit even though I cannot edit.

Expected: All edit pencils are marked as locked.
Actual: Only top edit pencil is marked as locked.

Screen Shot 2018-10-04 at 2.13.03 PM.png (586×1 px, 100 KB)

Developer notes

We used to hide section edit links in this situation, but don't do that any more.
Should we hide them, or should they also show the locked icon?
Hide them appears to be the answer! (T206265#4806240)

Related bug we fixed before: T190834

Reproduction steps

setup

  • Create account BlockedUser You can create a block locally for that account with an admin account by visiting Special:BlockUser.
    • Make sure to untick all boxes - in particular "Prevent this user from editing their own talk page while blocked" unticked (for test) and for your sanity do not "Prevent account creation" or "Automatically block the last IP address used by this user, and any subsequent IP addresses they try to edit from" (if you do you'll need to delete the block in ipblocks table in your database.
  • Disable wgMFContentProvider if configured.

Test

  • Login as BlockedUser
  • Visit any page with sections.

Acceptance criteria

  • For protected articles we exclude the edit icons from sections. When a user is blocked these edit icons should also be hidden - only the icon at the top of the page will be present.

QA Results

ACStatusDetails
1T206265#5496047

Event Timeline

Jdlrobson triaged this task as Medium priority.Nov 13 2018, 9:37 PM
Jdlrobson moved this task from Needs analysis to Queue on the Web-Team-Backlog (Design) board.
Jdlrobson added a subscriber: alexhollender_WMF.

This should be a quick question for you @alexhollender !

Seems like for protected articles we exclude the edit icons from sections. I think we should follow that pattern. Moving out of design.

ovasileva renamed this task from Bug: Section edit links are not marked as locked for blocked users to Bug: Section edit links should be hidden for blocked users.Jan 16 2019, 5:20 PM

@Volker_E @Niedzielski pointed out that the locked edit pencil is out of sync with edit icon graphic. Icon standardisation team to the rescue (?)

<li id="ca-edit" class="mw-ui-icon mw-ui-icon-element mw-ui-icon-minerva-edit" title="Edit the lead section of this page"><a href="http://localhost:8888/w/index.php?title=Singapore&amp;action=edit&amp;section=0" class="edit-page">Edit</a></li>

Screen Shot 2019-01-16 at 9.22.04 AM.png (71×62 px, 7 KB)

ovasileva set the point value for this task to 3.Jan 16 2019, 5:24 PM

Change 532794 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/skins/MinervaNeue@master] [edit] [UI] hide edit section links for blocked users

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

Niedzielski added a subscriber: pmiazga.

@pmiazga, given your experience, I think you're in an ideal spot to review this change. I refactored some of the "loose" page permission checks into the MinervaPagePermissions implementation as it seemed quite appropriate. What I'm most unsure of is if any special work is needed when adding new permission actions (a special config in skin.json). (I'm not sure why this is configurable.) The distinction from the plain old "EDIT" action was needed as some parts of the code only care whether the page content model is editable and others care whether the active user can edit.

Change 532794 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] [edit] [UI] hide edit section links for blocked users

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

@pmiazga where do you want me to test this? I may need assistance blocking myself :)

@Edtadros can beta cluster, can be staging. Let's proceed with staging, please share the user name that has to be blocked,

Edtadros subscribed.

Test Result

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA Steps

Login as BlockedUser
Visit any page with sections.
✅ AC1: For protected articles we exclude the edit icons from sections. When a user is blocked these edit icons should also be hidden - only the icon at the top of the page will be present.

T206265.gif (808×372 px, 2 MB)