1 user.api.php hook_user_role_update($role)

Respond to updates to a user role.

Modules implementing this hook can act on the user role object when updated. It's recommended that you implement this hook if your module adds additional data to user roles object. The module should save its custom additions to the database.


$role: A user role object.

Related topics


core/modules/user/user.api.php, line 402
Hooks provided by the User module.


function hook_user_role_update($role) {
  // Save extra fields provided by the module to user roles.
    ->key(array('role' => $role->name))
      'role_description' => $role->description