<commit_before>module WithPermissions
  extend ActiveSupport::Concern

  included do
    serialize :permissions, Mumukit::Auth::Permissions

    delegate :writer?, :janitor?, to: :permissions
  end

  def make_student_of!(slug)
    permissions.add_permission! :student, slug
  end

  def student_of?(organization)
    permissions.student? organization.slug
  end

  #FIXME may be able to remove now
  def student?
    student_of? Organization
  end

  def teacher?
    permissions.teacher? Organization.current.slug
  end

  def accessible_organizations
    permissions.accessible_organizations.map { |org| Organization.find_by(name: org) }.compact
  end

  def has_accessible_organizations?
    accessible_organizations.present?
  end

end<commit_msg>Fix typo<commit_after>module WithPermissions
  extend ActiveSupport::Concern

  included do
    serialize :permissions, Mumukit::Auth::Permissions

    delegate :writer?, :janitor?, to: :permissions
  end

  def make_student_of!(slug)
    permissions.add_permission! :student, slug
  end

  def student_of?(organization)
    permissions.student? organization.slug
  end

  #FIXME may be able to remove now
  def student?
    student_of? Organization.current
  end

  def teacher?
    permissions.teacher? Organization.current.slug
  end

  def accessible_organizations
    permissions.accessible_organizations.map { |org| Organization.find_by(name: org) }.compact
  end

  def has_accessible_organizations?
    accessible_organizations.present?
  end

end
{'fraction_non_alphanumeric': 0.07232913072329131, 'fraction_numerical': 0.0, 'mean_word_length': 4.328621908127208, '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': '2478547', 'n_tokens_mistral': 455, 'n_tokens_neox': 444, 'n_words': 112}