<commit_before># frozen_string_literal: true

module InventoriesHelper
  def inventory_shared_status_icon(inventory, team)
    if inventory.shared_with?(team)
      if inventory.shared_with_write?(team)
        draw_custom_icon('shared-edit')
      else
        draw_custom_icon('shared-read')
      end
    else
      # The icon should be hiden if repo is not shared (we're updating it dinamically)
      css_classes = ["repository-share-status"]
      css_classes.push("hidden") unless inventory.i_shared?(current_team)

      content_tag :span, class: css_classes.join(" ") do
        draw_custom_icon('i-shared')
      end
    end
  end
end<commit_msg>additional checking for icon: check also if user is guest<commit_after># frozen_string_literal: true

module InventoriesHelper
  def inventory_shared_status_icon(inventory, team)
    if inventory.shared_with?(team)
      if can_manage_repository_rows?(inventory)
        draw_custom_icon('shared-edit')
      else
        draw_custom_icon('shared-read')
      end
    else
      # The icon should be hiden if repo is not shared (we're updating it dinamically)
      css_classes = ["repository-share-status"]
      css_classes.push("hidden") unless inventory.i_shared?(current_team)

      content_tag :span, class: css_classes.join(" ") do
        draw_custom_icon('i-shared')
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08676470588235294, 'fraction_numerical': 0.0, 'mean_word_length': 3.462295081967213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2626311', 'n_tokens_mistral': 406, 'n_tokens_neox': 405, 'n_words': 100}