MediaWiki master
|
This is a hook handler interface, see docs/Hooks.md. More...
Inherited by MediaWiki\Rest\Hook\HookRunner.
Public Member Functions | |
onRestCheckCanExecute (Module $module, Handler $handler, string $path, RequestInterface $request, ?HttpException &$error) | |
Called when initializing a REST API request. | |
This is a hook handler interface, see docs/Hooks.md.
Use the hook name "RestCheckCanExecute" to register handlers implementing this interface.
Definition at line 19 of file RestCheckCanExecuteHook.php.
MediaWiki\Rest\Hook\RestCheckCanExecuteHook::onRestCheckCanExecute | ( | Module | $module, |
Handler | $handler, | ||
string | $path, | ||
RequestInterface | $request, | ||
?HttpException & | $error ) |
Called when initializing a REST API request.
Use this hook to deny requests to API endpoints belonging to a different component than the hook handler.
Module | $module | The module responsible for processing the request. (When the handler does not belong to a module, this will be an ExtraRoutesModule instance.) |
Handler | $handler | The handler responsible for processing the request. |
string | $path | Path of the request. When the handler belongs to a module, doesn't include the module prefix. |
RequestInterface | $request | |
HttpException | null | &$error | Set this to explain why the request cannot be executed. Should only be set when returning false. |
Implemented in MediaWiki\Rest\Hook\HookRunner.