MediaWiki master
MediaWiki\Rest\Hook\RestCheckCanExecuteHook Interface Reference

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.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "RestCheckCanExecute" to register handlers implementing this interface.

Since
1.44
See also
ApiCheckCanExecuteHook

Definition at line 19 of file RestCheckCanExecuteHook.php.

Member Function Documentation

◆ onRestCheckCanExecute()

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.

Parameters
Module$moduleThe module responsible for processing the request. (When the handler does not belong to a module, this will be an ExtraRoutesModule instance.)
Handler$handlerThe handler responsible for processing the request.
string$pathPath of the request. When the handler belongs to a module, doesn't include the module prefix.
RequestInterface$request
HttpException | null&$errorSet this to explain why the request cannot be executed. Should only be set when returning false.
Returns
bool Return false to block request execution. $error must be set.

Implemented in MediaWiki\Rest\Hook\HookRunner.


The documentation for this interface was generated from the following file: