< Manual:Hooks
| UserGetRightsRemove | |
|---|---|
| Available from version 1.32.0 (Gerrit change 462157) Dynamically removes from a user the rights implied by their group membership | |
| Define function: | public static function onUserGetRightsRemove( User $user, array &$aRights ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"UserGetRightsRemove": "MyExtensionHooks::onUserGetRightsRemove"
}
}
|
| Called from: | File(s): Permissions/PermissionManager.php Function(s): getUserPermissions |
| Interface: | UserGetRightsRemoveHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:UserGetRightsRemove extensions.
Details
$user: User to get rights for&$rights: Current rights
Called in User::getRights(), after the UserGetRights hook has finished. It can be used to remove rights in a safe way (which would not be possible in UserGetRights as there's no way to guarantee that the next hook handler won't re-add the right). Therefore, UserGetRightsRemove handlers should never add rights, only remove them.
See also
- UserGetRights
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.