Manual:Hooks/RestCheckCanExecute

Category:MediaWiki hooks#RestCheckCanExecute Category:Hooks added in MediaWiki 1.44.0#RestCheckCanExecute
RestCheckCanExecute
Available from version 1.44.0 (Gerrit change 1112109)
Called when initializing a REST API request.
Define function:
public static function onRestCheckCanExecute( MediaWiki\Rest\Module\Module $module,
	MediaWiki\Rest\Handler $handler,
	string $path,
	MediaWiki\Rest\RequestInterface $request,
	?MediaWiki\Rest\HttpException &$error ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"RestCheckCanExecute": "MediaWiki\\Extension\\MyExtension\\Hooks::onRestCheckCanExecute"
	}
}
Called from: File(s): Rest/Module/Module.phpCategory:MediaWiki hooks included in Module.php#RestCheckCanExecute
Interface: RestCheckCanExecuteHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:RestCheckCanExecute extensions.

Use this hook to deny requests to API endpoints belonging to a different component than the hook handler.

Category:Hooks added in MediaWiki 1.44.0 Category:MediaWiki hooks Category:MediaWiki hooks included in Module.php