3 namespace MediaWiki\Api\Hook
;
5 use MediaWiki\Api\ApiMessage
;
6 use MediaWiki\Api\ApiQueryBase
;
7 use MediaWiki\Permissions\Authority
;
8 use Wikimedia\Message\MessageSpecifier
;
11 * This is a hook handler interface, see docs/Hooks.md.
12 * Use the hook name "ApiQueryCheckCanExecute" to register handlers implementing this interface.
14 * @stable to implement
17 interface ApiQueryCheckCanExecuteHook
{
20 * This hook is called during at the beginning of ApiQuery::execute and can be used to prevent
21 * execution of query submodules.
25 * @param ApiQueryBase[] $modules
26 * @param Authority $authority Current user
27 * @param MessageSpecifier|string|array &$message API message to die with.
28 * @return bool|void True or no return value to continue, or false and set a
29 * message to cancel the request
31 * @see ApiMessage::create() for how the $message parameter is interpreted.
32 * @see ApiCheckCanExecuteHook for non-query modules.
34 public function onApiQueryCheckCanExecute( $modules, $authority, &$message );