aboutsummaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
blob: 0b22f4b6401ad7205e00ad4300b7a3be565347c1 (plain)
1
2
3
4
5
6
7
8
9
10
module ApplicationHelper
  def current_agency
    current_user.agencies.where(agent: current_agent).first
  end
  %w(observer editor maintainer leader).each do |role|
    define_method :"current_user_#{role}?" do
      current_agency.send(:"#{role}?")
    end
  end
end