Manual:Hooks/UserGetImplicitGroups

Category:MediaWiki hooks#UserGetImplicitGroups Category:Hooks added in MediaWiki 1.11.0#UserGetImplicitGroups Category:MediaWiki deprecated or obsolete features#UserGetImplicitGroups Category:Hooks removed in MediaWiki 1.32.0#UserGetImplicitGroups Category:Hooks deprecated in MediaWiki 1.25.0#UserGetImplicitGroups
UserGetImplicitGroups
Available from version 1.11.0
Removed in version 1.32.0 (Gerrit change 465784)Category:Removed hooks#UserGetImplicitGroups
Dynamically adds to or removes from the list of available groups.
Define function:
public static function onUserGetImplicitGroups( &$aGroups ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserGetImplicitGroups": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserGetImplicitGroups"
	}
}
Called from: File(s): User.phpCategory:MediaWiki hooks included in User.php#UserGetImplicitGroups
Interface: UserGetImplicitGroupsHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UserGetImplicitGroups extensions.

Use cases

This hook may be used as part of an extension that synchronizes the list of available groups with external applications or the host operating system.

Implementation background

MediaWiki supports the assignment of group-based user rights. The list of available groups is defined by three sources: groups hard coded into MediaWiki (*, user, autoconfirmed, emailconfirmed), the keys of the $wgGroupPermissions configuration variable and the groups added or filtered by this hook.

Usage

Implementers return a list of groups that should be added. The source for the list may be a hard coded list, a file, a database table, a third party application, or anything else a programmer's imagination can dream up.

Category:Hooks added in MediaWiki 1.11.0 Category:Hooks deprecated in MediaWiki 1.25.0 Category:Hooks removed in MediaWiki 1.32.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in User.php Category:Removed hooks