API: Allow prop=info intestactions to return reasons
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 27 Sep 2018 15:04:24 +0000 (11:04 -0400)
committerDavid Barratt <dbarratt@wikimedia.org>
Tue, 16 Oct 2018 16:37:40 +0000 (12:37 -0400)
commit20d18cf3cb118cd09028e4d4f4939850e5023207
treedbdbe4e07af4f8af6d78fdc1691e291aafefc011
parent943c2f0bc1d65f759c8b56faf1e008991a41f2e8
API: Allow prop=info intestactions to return reasons

T194585 raises a use case for callers to be able to know why an action
is not allowed. We can make that possible easily enough. The default
remains to return only a boolean.

This also deprecates inprop=readable in favor of intestactions=read,
since they both just return `$title->userCan( 'read', $user )`.

(ApiQueryInfoTest added by David Barratt)

Bug: T194585
Change-Id: Ib880f0605880eac776d816ea04e0c7ab9cfbaab1
Co-Authored-By: David Barratt <dbarratt@wikimedia.org>
RELEASE-NOTES-1.32
includes/api/ApiErrorFormatter.php
includes/api/ApiQueryInfo.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
tests/phpunit/includes/api/ApiErrorFormatterTest.php
tests/phpunit/includes/api/ApiQueryInfoTest.php [new file with mode: 0644]