Debian Codegraph @

includes/Permissions/Hook/GetUserPermissionsErrorsExpensiveHook.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Permissions\Hook;
4
5 use MediaWiki\Title\Title;
6 use MediaWiki\User\User;
7 use Wikimedia\Message\MessageSpecifier;
8
9 /**
10 * This is a hook handler interface, see docs/Hooks.md.
11 * Use the hook name "getUserPermissionsErrorsExpensive" to register handlers implementing this interface.
12 *
13 * @stable to implement
14 * @ingroup Hooks
15 */
16 interface GetUserPermissionsErrorsExpensiveHook {
17 /**
18 * This hook is equal to getUserPermissionsErrors, but it is called only if
19 * expensive checks are enabled. Use this hook to add a permissions error when
20 * permissions errors are checked for. Return false if the user can't do it, and
21 * populate $result with the reason in the form of [ messagename, param1, param2,
22 * ... ] or a MessageSpecifier instance (you might want to use ApiMessage to
23 * provide machine-readable details for the API).
24 *
25 * @since 1.35
26 *
27 * @param Title $title Title being checked against
28 * @param User $user Current user
29 * @param string $action Action being checked
30 * @param array|string|MessageSpecifier &$result User permissions error to add. If none, return true.
31 * For consistency, error messages should be plain text with no special coloring,
32 * bolding, etc. to show that they're errors; presenting them properly to the
33 * user as errors is done by the caller.
34 * @return bool|void True or no return value to continue or false to abort
35 */
36 public function onGetUserPermissionsErrorsExpensive( $title, $user, $action,
37 &$result
38 );
39 }