Manual:Hooks/UserPrivilegedGroups
Appearance
| UserPrivilegedGroups | |
|---|---|
| Available from version 1.39.5 (Gerrit change 954629) Use this hook to extend what MediaWiki considers to be a "privileged group" beyond the values set in $wgPrivilegedGroups | |
| Define function: | public static function onUserPrivilegedGroups( MediaWiki\User\UserIdentity $userIdentity, array &$groups ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"UserPrivilegedGroups": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserPrivilegedGroups"
}
}
|
| Called from: | File(s): User/UserGroupManager.php |
| Interface: | UserPrivilegedGroupsHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:UserPrivilegedGroups extensions.
Details
[edit]$userIdentity: User identity to get groups for (type:MediaWiki\User\UserIdentity)&$groupsCurrent privileged groups, to be altered by the hook (type: list of strings)