Sha256: 919edd7293adbf63ae28f167a33eebf85317774bb1da29da9ed7f4335a860243

Contents?: true

Size: 698 Bytes

Versions: 3

Compression:

Stored size: 698 Bytes

Contents

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

    autoload :Role
    autoload :RoleAttribute
    autoload :RoleSet
    autoload :RoleSetManager
    autoload :RoleSetQuery
    autoload :RoleType
    autoload :RoleTypes
    autoload :RoleValidator

    include RoleTypes

    RESOURCE_SCOPE = "resource".freeze
    POLICY_SCOPE = "policy".freeze
    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(false).map { |const| RoleTypes.const_get(const) }
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.3 lib/ddr/auth/roles.rb
ddr-models-3.0.0.beta.2 lib/ddr/auth/roles.rb
ddr-models-3.0.0.beta.1 lib/ddr/auth/roles.rb