<commit_before>class TreeBuilderReportRoles < TreeBuilder
  private

  def tree_init_options(tree_name)
    {
      :leaf     => 'Roles',
      :full_ids => true
    }
  end

  def set_locals_for_render
    locals = super
    locals.merge!(
      :id_prefix => 'roles_',
      :autoload  => true
    )
  end

  # Get root nodes count/array for explorer tree
  def x_get_tree_roots(count_only, _options)
    user = User.current_user
    if user.super_admin_user?
      roles = MiqGroup.all
    else
      roles = [MiqGroup.find_by_id(user.miq_group.id)]
    end
    count_only_or_objects(count_only, roles.sort_by { |o| o.name.downcase }, 'name')
  end
end<commit_msg>Update caller of User#miq_group to User#current_group (transferred from ManageIQ/manageiq@6668d<PASSWORD>c25<PASSWORD>f<PASSWORD>f<PASSWORD>1f)<commit_after>class TreeBuilderReportRoles < TreeBuilder
  private

  def tree_init_options(tree_name)
    {
      :leaf     => 'Roles',
      :full_ids => true
    }
  end

  def set_locals_for_render
    locals = super
    locals.merge!(
      :id_prefix => 'roles_',
      :autoload  => true
    )
  end

  # Get root nodes count/array for explorer tree
  def x_get_tree_roots(count_only, _options)
    user  = User.current_user
    roles = user.super_admin_user? ? MiqGroup.all : [user.current_group]
    count_only_or_objects(count_only, roles.sort_by { |o| o.name.downcase }, 'name')
  end
end
{'fraction_non_alphanumeric': 0.09723207948899928, 'fraction_numerical': 0.0049680624556423, 'mean_word_length': 3.246987951807229, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '663331', 'n_tokens_mistral': 516, 'n_tokens_neox': 506, 'n_words': 99}