module RoleBarHelper

  def role_bar
    raw content_tag(:div, content_tag(:ul, role_list), :id => :role_bar) if user_signed_in? or in_bootstrap_mode?
  end

  def role_list
    ni = navigation_items
    ni.blank? ? '' : render_navigation(:items => ni)
  end

  def navigation_items
    in_bootstrap_mode? ? Role.all : ((current_user.roles_including_identity if user_signed_in?) || [])
  end

end