function hook_user_role_insert

7.x user.api.php hook_user_role_insert($role)

Inform other modules that a user role has been added.

Modules implementing this hook can act on the user role object when saved to the database. 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

1 invocation of hook_user_role_insert()
user_role_save in drupal/modules/user/user.module
Save a user role to the database.


drupal/modules/user/user.api.php, line 418
Hooks provided by the User module.


function hook_user_role_insert($role) {
  // Save extra fields provided by the module to user roles.
    'rid' => $role->rid,
    'role_description' => $role->description,