Jump to content

Manual:Hooks/UserPrivilegedGroups

From mediawiki.org
UserPrivilegedGroups
Available from version 1.41.0 (Gerrit change 482589)
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): includes/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
  • &$groups Current privileged groups, to be altered by the hook

See also

[edit]