Act on a user role being inserted or updated.
Modules implementing this hook can act on the user role object before it has been saved to the database.
$role: A user role object.
function hook_user_role_presave($role) {
// Set a UUID for the user role if it doesn't already exist
if (empty($role->uuid)) {
$role->uuid = uuid_uuid();
}
}