MediaWiki  master
MediaWiki\Permissions\Hook\UserCanHook Interface Reference

Stable to implement. More...

Inheritance diagram for MediaWiki\Permissions\Hook\UserCanHook:

Public Member Functions

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

Detailed Description

Stable to implement.

Definition at line 12 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: