<commit_before>class Ability
  include CanCan::Ability

  def initialize(user)
    if user.nil?
    else
      if user.has_role? :super_admin
        can :access, :rails_admin
        can :dashboard
        can :manage, :all
        can :all, StandardSkillRoutine
        return # required in order to allow rails_admin to function
      end

      # Competitor Assignment
      if user.has_role? :admin
        can :manage, Competitor
      elsif user.has_role? :judge
        can :read, Competitor
      end

      # Scoring abilities
      if user.has_role? :judge
        can :read, Competition
        can :create_scores, Competition do |competition|
          !competition.locked<commit_msg>allow judges to see the my events menu<commit_after>class Ability
  include CanCan::Ability

  def initialize(user)
    if user.nil?
    else
      if user.has_role? :super_admin
        can :access, :rails_admin
        can :dashboard
        can :manage, :all
        can :all, StandardSkillRoutine
        return # required in order to allow rails_admin to function
      end

      # Competitor Assignment
      if user.has_role? :admin
        can :manage, Competitor
      elsif user.has_role? :judge
        can :read, Competitor
      end

      # Scoring abilities
      if user.has_role? :judge
        can :judging, Event
        can :read, Competition
        can :create_scores, Competition do |competition|
          !competition.locked
{'fraction_non_alphanumeric': 0.0635798203178991, 'fraction_numerical': 0.0, 'mean_word_length': 2.224944320712695, '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': '7351764', 'n_tokens_mistral': 428, 'n_tokens_neox': 411, 'n_words': 133}