Page MenuHomePhabricator

Bug: Section edit links should be hidden for blocked users
Closed, ResolvedPublic3 Estimate 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.

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

Details

Related Gerrit Patches:
mediawiki/skins/MinervaNeue : master[edit] [UI] hide edit section links for blocked users

Event Timeline

Jdlrobson created this task.Oct 4 2018, 9:20 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 4 2018, 9:20 PM
Jdlrobson triaged this task as Medium priority.Nov 13 2018, 9:37 PM
Jdlrobson moved this task from Needs analysis to Queue on the Readers-Web-Backlog (Design) board.
Jdlrobson added a subscriber: alexhollender.

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.

Jdlrobson updated the task description. (Show Details)Dec 11 2018, 5:51 PM
Jdlrobson added a project: good first task.
Jdlrobson updated the task description. (Show Details)Jan 16 2019, 5:19 PM
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>

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.

sure, I'll check it

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 reassigned this task from Edtadros to ovasileva.Sep 16 2019, 2:39 PM
Edtadros added a subscriber: Edtadros.

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.

Edtadros updated the task description. (Show Details)Sep 16 2019, 2:40 PM
ovasileva closed this task as Resolved.Sep 17 2019, 8:19 AM

All done!