MediaWiki master
MediaWiki\Hook\SpecialUserRightsChangeableGroupsHook Interface Reference

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

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onSpecialUserRightsChangeableGroups (Authority $authority, UserIdentity $target, array $addableGroups, array &$restrictedGroups)
 This hook is called on checking changeable groups in SpecialUserRights.
 

Detailed Description

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

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

Stability: stable
to implement

Definition at line 15 of file SpecialUserRightsChangeableGroupsHook.php.

Member Function Documentation

◆ onSpecialUserRightsChangeableGroups()

MediaWiki\Hook\SpecialUserRightsChangeableGroupsHook::onSpecialUserRightsChangeableGroups ( Authority $authority,
UserIdentity $target,
array $addableGroups,
array & $restrictedGroups )

This hook is called on checking changeable groups in SpecialUserRights.

Allow extensions to specify groups that the performing user may not add for this target user, which they would usually be allowed to add, according to the AddGroups config.

Since
1.45
Parameters
Authority$authorityThe user performing the group change
UserIdentity$targetThe target user whose groups may be changed. This could be a user from an external wiki.
array$addableGroupsArray Names of groups that the performer is allowed to add
array&$restrictedGroupsMap of groups that require some condition to be met in order to be added. The hook handlers are expected to evaluate the relevant conditions, and determine if they are met and if the performer is able to ignore the condition not being met. Don't include groups here that the performer is not allowed to add at all (i.e. that are not in $addableGroups). The expected format is: ‘[ 'groupname’ => [ 'condition-met' => bool, 'ignore-condition' => bool, 'message' => string ] ]‘, where 'message’ is a message key that will be shown if the condition is not met, regardless of whether it's ignored or not.
Returns
void This hook must not abort, it must return no value

Implemented in MediaWiki\HookContainer\HookRunner.


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