< Manual:Hooks
UserRights
Available from version 1.6.0
Removed in version 1.34.0
Called after a user's group memberships are changed
Define function:
public static function onUserRights( $user, array $add, array $remove ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserRights": "MyExtensionHooks::onUserRights"
	}
}
Called from: File(s): specials/SpecialUserrights.php
Interface: UserRightsHook.php

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

Details

  • $user: User or UserRightsProxy object that was changed
  • $add: Array of strings corresponding to groups added
  • $remove: Array of strings corresponding to groups removed

If the $user parameter was a UserRightsProxy object, this user rights change was performed on a different wiki. This means that you might be mislead into identifying a user based on information such a name or ID because they do not share that attribute on the local wiki - it will almost certainly point to a different user entirely.

Additionally, the $user parameter could be a CentralAuthGroupMembershipProxy object from Extension:CentralAuth in the case of a global user rights change. The information given by this object represents a global account shared across wikis, and the ID will not match the attached local account IDs.

See also

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.