<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :authenticate_user!
  before_filter :require_supervisor
  before_filter :require_admin

  def require_admin
    redirect_unauthorized_request unless ( !current_user.nil? && current_user.role == 2 )
  end

  def require_supervisor
    # Also allow admins, otherwise it fails
    if(current_user.nil?)
      print("You are not logged in")
    else
      print("Your role is #{current_user.role}, and your encrypted password is #{current_user.encrypted_password}")
    end

    redirect_unauthorized_request unless ( (!current_user.nil?) && (current_user.role == 1 || current_user.role == 2) )
  end

  def redirect_unauthorized_request
    flash[:info] = "You do not have the permissions required to view this page."
    redirect_to dashboard_path
  end
  
  def after_sign_in_path_for(resource)
   dashboard_path
  end
  
  def after_update_path_for(resource)
    profile_user_path(resource)
  end
end<commit_msg>Removed nasty test variable dump<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :authenticate_user!
  before_filter :require_supervisor
  before_filter :require_admin

  def require_admin
    redirect_unauthorized_request unless ( !current_user.nil? && current_user.role == 2 )
  end

  def require_supervisor
    redirect_unauthorized_request unless ( (!current_user.nil?) && (current_user.role == 1 || current_user.role == 2) )
  end

  def redirect_unauthorized_request
    flash[:info] = "You do not have the permissions required to view this page."
    redirect_to dashboard_path
  end
  
  def after_sign_in_path_for(resource)
   dashboard_path
  end
  
  def after_update_path_for(resource)
    profile_user_path(resource)
  end
end
{'fraction_non_alphanumeric': 0.06985698569856985, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 4.579754601226994, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5988821', 'n_tokens_mistral': 554, 'n_tokens_neox': 534, 'n_words': 135}