Last modified: 2012-11-28 19:46:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44142, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42142 - VisualEditor: Don't offer Edit button when user cannot edit page
VisualEditor: Don't offer Edit button when user cannot edit page
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: Normal normal
: VE-deploy-2012-12-10
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-15 05:56 UTC by MZMcBride
Modified: 2012-11-28 19:46 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description MZMcBride 2012-11-15 05:56:14 UTC
The VisualEditor interface does not currently recognize page protection. If a user visits a protected page (a page to which he or she does not have access to edit), VisualEditor will still display a working edit form and the first click of the "Save page" button will work. It will produce a dialog box that will present a second "Save page" button that does not work. Ideally, VisualEditor would not let a user get this far without indicating that the page is uneditable.

Related to this, there's no warning for administrators that a page is protected when they're editing the page. This may be a separate bug, however.
Comment 1 Roan Kattouw 2012-11-17 01:25:36 UTC
We should be able to detect in JS whether the user has the edit permission for this page. One way we can detect this is by checking whether the user gets an edit tab or a view source tab.
Comment 2 Krinkle 2012-11-17 03:49:58 UTC
We have mw.user.getRights()[async] now in core as well.
Comment 3 Krinkle 2012-11-17 03:51:14 UTC
And for the current page, I suppose wgRestrictionEdit and wgUserGroups could be used.
Comment 4 Krinkle 2012-11-27 22:12:58 UTC
I suppose the lazy solution (use the presence of a button outputted by server side) is sufficient, especially given that if someone games it, saving will still fail. Its only for the UI.
Comment 5 Krinkle 2012-11-28 01:49:37 UTC
If we do that it means we can no longer pseudo-restrict "Edit source" on a different level than "VisualEditor Edit".

e.g. on MediaWiki.org we protected the namespace with sysop, but allowed users to edit it with VE.
Comment 6 Krinkle 2012-11-28 18:12:04 UTC
That's not a problem I guess, but I noticed while implementing it that it was a matter of removing the code that explicitly ignored the presence of the edit button for sysops.

Change-Id: I3fe29c52b743837c2e1d66f25ccdca6115b8bd25
Comment 7 James Forrester 2012-11-28 18:24:47 UTC
Yeah, well, different "protection" levels for VE and non-VE editors feels like the wrong kind of solution.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links