Sha256: 7e59de297056fa01de5ab727ef211e420b44261ac4f88bf67690f740a47f1f4e

Contents?: true

Size: 422 Bytes

Versions: 160

Compression:

Stored size: 422 Bytes

Contents

module Ddr::Auth
  class AffiliationGroups

    all = []

    Affiliation::ALL.each do |affiliation|
      group = Group.new "duke.#{affiliation}",
                        label: "Duke #{affiliation.capitalize}" do |auth_context|
        auth_context.affiliation.include? affiliation
      end

      const_set affiliation.upcase, group

      all << const_get(affiliation.upcase)
    end

    ALL = all.freeze

  end
end

Version data entries

160 entries across 160 versions & 2 rubygems

Version Path
ddr-models-2.4.11 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.8 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.7 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.6 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.5 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.4 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.3 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.2 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.1 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc6 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc5 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc4 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc3 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc2 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.rc1 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.beta.22 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.beta.21 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.4.10 lib/ddr/auth/affiliation_groups.rb
ddr-models-3.0.0.beta.20 lib/ddr/auth/affiliation_groups.rb