MediaWiki master
MediaWiki\Permissions\Hook\UserCanHook Interface Reference

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

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onUserCan ( $title, $user, $action, &$result)
 Use this hook to interrupt or advise the "user can do X to Y article" check.
 

Detailed Description

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

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

Deprecated
since 1.37 use getUserPermissionsErrors or getUserPermissionsErrorsExpensive instead.

Definition at line 15 of file UserCanHook.php.

Member Function Documentation

◆ onUserCan()

MediaWiki\Permissions\Hook\UserCanHook::onUserCan ( $title,
$user,
$action,
& $result )

Use this hook to interrupt or advise the "user can do X to Y article" check.

If you want to display an error message, try getUserPermissionsErrors.

Since
1.35
Parameters
Title$titleTitle being checked against
User$userCurrent user
string$actionAction being checked
string&$resultPointer to result returned if hook returns false. If null is returned, userCan checks are continued by internal code.
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


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