Sha256: f038d49e2bed368e8cf5a1bb10b508fc9afc5e33b396d80a3232828f1d1238c4

Contents?: true

Size: 728 Bytes

Versions: 36

Compression:

Stored size: 728 Bytes

Contents

module Ddr::Auth
  module Roles
    extend ActiveSupport::Autoload

    autoload :Role
    autoload :RoleType
    autoload :RoleTypes

    include RoleTypes

    RESOURCE_SCOPE = "resource".freeze
    POLICY_SCOPE = "policy".freeze
    SCOPES = [ RESOURCE_SCOPE, POLICY_SCOPE ].freeze

    ORDERED_ROLE_TYPES = [
      CURATOR,
      EDITOR,
      METADATA_EDITOR,
      CONTRIBUTOR,
      DOWNLOADER,
      VIEWER,
      METADATA_VIEWER
    ]

    class << self
      def type_map
        @type_map ||= role_types.map { |role_type| [role_type.to_s, role_type] }.to_h
      end

      def role_types
        ORDERED_ROLE_TYPES
      end

      def titles
        @titles ||= role_types.map(&:title)
      end
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ddr-core-1.17.0 lib/ddr/auth/roles.rb
ddr-core-1.16.0 lib/ddr/auth/roles.rb
ddr-core-1.15.0 lib/ddr/auth/roles.rb
ddr-core-1.14.0 lib/ddr/auth/roles.rb
ddr-core-1.13.2 lib/ddr/auth/roles.rb
ddr-core-1.13.1 lib/ddr/auth/roles.rb
ddr-core-1.13.0 lib/ddr/auth/roles.rb
ddr-core-1.12.2 lib/ddr/auth/roles.rb
ddr-core-1.12.1 lib/ddr/auth/roles.rb
ddr-core-1.12.0 lib/ddr/auth/roles.rb
ddr-core-1.11.0 lib/ddr/auth/roles.rb
ddr-core-1.10.0 lib/ddr/auth/roles.rb
ddr-core-1.9.0 lib/ddr/auth/roles.rb
ddr-core-1.8.0 lib/ddr/auth/roles.rb
ddr-core-1.7.0 lib/ddr/auth/roles.rb
ddr-core-1.6.6 lib/ddr/auth/roles.rb
ddr-core-1.6.5 lib/ddr/auth/roles.rb
ddr-core-1.6.4 lib/ddr/auth/roles.rb
ddr-core-1.6.3 lib/ddr/auth/roles.rb
ddr-core-1.6.2 lib/ddr/auth/roles.rb