Manual:Hooks/RestCheckCanExecute
Appearance
From mediawiki.org
| 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.php |
| 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.