Manual:Hooks/ReadPrivateUserRequirementsCondition
Appearance
| ReadPrivateUserRequirementsCondition | |
|---|---|
| Available from version 1.46.0 (Gerrit change 1233183) allows to log access to private user requirements conditions. | |
| Define function: | public static function onReadPrivateUserRequirementsCondition( UserIdentity $performer, UserIdentity $target, array $conditions ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"ReadPrivateUserRequirementsCondition": "MediaWiki\\Extension\\MyExtension\\Hooks::onReadPrivateUserRequirementsCondition"
}
}
|
| Called from: | File(s): User/UserGroupAssignmentService.php |
| Interface: | ReadPrivateUserRequirementsConditionHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ReadPrivateUserRequirementsCondition extensions.
Details
[edit]This hook is trigerred when someone tries to add user to a group, which uses a private condition (as specified by $wgUserRequirementsPrivateConditions). It's given a list of private conditions that were evaluated while validating if user can be added to the requested groups.
Note that this hook is run for both successful and failed attempts to add user to a group. There's no parameter that would allow for discerning these two.
| Name | Description |
|---|---|
| $performer | The user who performed the request to change groups. This is the person who learned some private information |
| $target | The user whose groups were changed (or attempted to be changed) |
| $conditions | Private conditions that were used |