Page MenuHomePhabricator

make sure page protection works for data items
Closed, ResolvedPublic

Description

MediaWiki supports different levels of page protected. We should make sure this protection is applied to changes to wikidata items.

If Title::userCan() is used everywhere to check access before any modifications are applied, this *should* be sufficient, as that is supposed to check page protection too.

It's a bit unclear to me on what level the checks should be performed. Probably, the API should check, and perhaps Item::save should check again.

There should also be unit tests checking that user permissions and page protection are working.


Version: master
Severity: blocker
Whiteboard: storypoints: 2

Details

Reference
bz37588

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 12:23 AM
bzimport set Reference to bz37588.
bzimport added a subscriber: Unknown Object (MLST).

Changed isAllowed with userCan, but it seems like the page is a bit overly protective as a blocked user can't see the content at all. Perhaps its only my setup?

Approx idea for permissions/protections is that page protection and user blocking forms a lower bound on protecting page content with "userCan", and a more fine grained permission is built on top of that with "isAllowed". For now individual calls to content changing calls to the API is guarded, but later individual fields could be protected if necessary.

Blocked users should be able to read, unless the wiki is private (reading is not allowed for anons) and wgBlockDisablesLogin is set.

Please compare the behavior for item pages to the behavior for wikitext pages. It should be the same wrt blocking/protection.

Note: ItemViewAction needs to return false from requiresUnblock(), otherwise blocked users can't view. Maybe ItemViewAction should just extend ViewAction? Will look at this in the context of bug 37682.

Created attachment 10796
Screendump showing the effect of the block message on the page display.

Attached:

Bug_37588.png (751×1 px, 87 KB)