module TitlesHelper

  def get_restric(tpgn, prov)
    autho = {}
    prov.each do |p_id|
      p = Provider.find(p_id)
      unless p.is_pixtech_author?
        tpg = TitleProviderGroup.where(title_provider_group_name_id: tpgn, provider_id: p_id)
        autho[p_id] = 0
        autho[p_id] = Authorization.where(title_provider_group_id: tpg.first.id).count + 1 unless tpg.blank?
      end
    end
    autho
  end

end