app/controllers/application_controller.rb
# Run authorization on all actions
# check_authorization
Run authorization on all actions
check_authorization
Run authorization on all actions check_authorization
def raise_error_if_not_authorized_run(run)
    begin
      authorize! :access, run
    rescue
      @hide_navigation = true
      @user = current_user ? current_user.email : 'anonymous'
      @run_key = params[:run_key] || 'no run key'
      @sequence_run_key = params[:sequence_run_key] || 'no sequence run key'
      @session = session.clone
      NewRelic::Agent.notice_error(RuntimeError.new("_run_user_id_mismatch"), {
        uri: request.original_url,
        referer: request.referer,
        request_params: params,
        custom_params: { user: @user, run_key: @run_key, sequence_run_key: @sequence_run_key }.merge(@session)
      })
      raise NotAuthorizedRunError
    end
  end
def raise_error_if_not_authorized_run ( run ) begin authorize! :access , run rescue @hide_navigation = true @user = current_user ? current_user . email : 'anonymous' @run_key = params [ :run_key ] || 'no run key' @sequence_run_key = params [ :sequence_run_key ] || 'no sequence run key' @session = session . clone NewRelic :: Agent . notice_error ( RuntimeError . new ( "_run_user_id_mismatch" ) , { uri : request . original_url , referer : request . referer , request_params : params , custom_params : { user : @user , run_key : @run_key , sequence_run_key : @sequence_run_key } . merge ( @session ) } ) raise NotAuthorizedRunError end end
Run authorization on all actions
check_authorization
Run authorization on all actions check_authorization
run
<not_specific>