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-core-0.3.0 lib/ddr/auth/affiliation_groups.rb
ddr-core-0.2.2 lib/ddr/auth/affiliation_groups.rb
ddr-core-0.2.1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.11.0 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.10.2 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.10.1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.10.0 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.10.0.rc2 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.10.0.rc1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.9.2 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.9.1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.9.0 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.9.0.rc1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.8.0 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.8.0.rc1 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.7.6 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.7.5 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.7.4 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.7.3 lib/ddr/auth/affiliation_groups.rb
ddr-models-2.7.2 lib/ddr/auth/affiliation_groups.rb