Page MenuHomePhabricator

Do not show "Did you know that you can edit this page?" if user is not allowed to edit current page
Closed, ResolvedPublic

Description

Do not offer 'Did you know that you can edit this page?' when page is protected. Spotted today at http://en.wikipedia.org/wiki/Justin_Bieber as IP.


Version: unspecified
Severity: normal

Details

Reference
bz28737

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:28 PM
bzimport added a project: ArticleFeedback.
bzimport set Reference to bz28737.

$.inArray returns an index or -1 if not found -- not a boolean as one apparently expects.

Changing bugsummary. The edit-dyk-pitch shouldn't be hidden just because a page is protected, instead only if the user is not allowed to edit the current page (ie. semi- or fullprotection for anonymous/new users, and fullprotection for autoconfirmed users)

I suggest implementing a mw.user.isAllowed-ish function (or mw.user.canEdit() for starters).