Sha256: c7345a240d6066a289488e3eef1a3f331b34e7e3fbdcf5dc8e7627b73d5623bc

Contents?: true

Size: 637 Bytes

Versions: 9

Compression:

Stored size: 637 Bytes

Contents

module Ddr
  module Auth
    module Roles
      extend ActiveSupport::Autoload

      autoload :Role
      autoload :RoleSet
      autoload :RoleType
      autoload :RoleTypes
      autoload :Query

      include RoleTypes

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

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

        def role_types
          @role_types ||= RoleTypes.constants.map { |const| RoleTypes.const_get(const) }
        end
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ddr-models-1.17.1 lib/ddr/auth/roles.rb
ddr-models-1.17.0 lib/ddr/auth/roles.rb
ddr-models-1.16.2 lib/ddr/auth/roles.rb
ddr-models-1.16.1 lib/ddr/auth/roles.rb
ddr-models-1.16.0 lib/ddr/auth/roles.rb
ddr-models-1.15.0 lib/ddr/auth/roles.rb
ddr-models-1.14.2 lib/ddr/auth/roles.rb
ddr-models-1.14.1 lib/ddr/auth/roles.rb
ddr-models-1.14.0 lib/ddr/auth/roles.rb