<commit_before>class ChannelPolicy < ApplicationPolicy

  def index?
    true
  end

  def show?
    record.approved? || User.exists?(user)
  end

  def create?
    record.entity.has_user?(user) || user.is_admin?
  end

  def new?
    create?
  end

  def update?
    create?
  end

  def destroy?
    record.entity.has_user?(user) || user.is_admin?
  end

  def refresh?
    user.is_admin?
  end

  def transfer?
    user.is_admin?
  end

  def permitted_attributes
    permitted = [:name, :description, :service_identifier, :url, :avatar_url, :primary,
        :keyword_ids => [], contact_attributes: [:id, :name, :organization, :url, :phone, :email]]

    transfer? ? (permitted << :entity_id) : permitted
  end


end
<commit_msg>Allow token_id to be passed in<commit_after>class ChannelPolicy < ApplicationPolicy

  def index?
    true
  end

  def show?
    record.approved? || User.exists?(user)
  end

  def create?
    record.entity.has_user?(user) || user.is_admin?
  end

  def new?
    create?
  end

  def update?
    create?
  end

  def destroy?
    record.entity.has_user?(user) || user.is_admin?
  end

  def refresh?
    user.is_admin?
  end

  def transfer?
    user.is_admin?
  end

  def permitted_attributes
    permitted = [:name, :description, :service_identifier, :url, :avatar_url, 
                 :primary, :token_id,
        :keyword_ids => [], contact_attributes: [:id, :name, :organization, :url, :phone, :email]]

    transfer? ? (permitted << :entity_id) : permitted
  end


end

{'fraction_non_alphanumeric': 0.1164021164021164, 'fraction_numerical': 0.0, 'mean_word_length': 2.9920844327176783, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '2464504', 'n_tokens_mistral': 530, 'n_tokens_neox': 510, 'n_words': 128}