function wdp_get_all_groups_list() {
  $groups = array();
  if (function_exists('_groups_get_tablename')) {
    global $wpdb;
    $groups_table = _groups_get_tablename('group');
    $groups = $wpdb->get_results("SELECT * FROM $groups_table ORDER BY name");
  }

  return is_array($groups) ? $groups : array();
}

add_filter('wdp_preloaded_list_user_roles', function ($list) {
  foreach(wdp_get_all_groups_list() as $group) {
    $list[] = array(
      'id' => '(group)' . strtolower($group->name) ,
      'text' => '(group) ' . $group->name,
    );
  }

  return $list;
});

add_filter('wdp_current_user_roles', function ($roles) {
  foreach(wdp_get_all_groups_list() as $group) {
    $roles[] = '(group)' . strtolower($group->name);
  }

  return $roles;
});