Manual:Hooks/UserGetImplicitGroups

From MediaWiki.org

Jump to: navigation, search
UserGetImplicitGroups
Available from version 1.11.0
Dynamically adds to or removes from the list of available groups.

*Define function:
function fnMyHook(&$aGroups) { ... }

*Attach hook:
$wgHooks['UserGetImplicitGroups'][] = 'fnMyHook';
Called from: User.php

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


[edit] 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.

[edit] 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.

[edit] 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.

Personal tools