Sha256: 207643471af5e58569dafe682ec8ea02bdcccae16ee95c6d869e31282be9cdad
Contents?: true
Size: 829 Bytes
Versions: 49
Compression:
Stored size: 829 Bytes
Contents
require "delegate" module Ddr::Auth class LegacyAuthorization < SimpleDelegator def to_roles sources.map(&:to_roles).reduce(&:merge) end def clear sources.each(&:clear) end def clear? sources.all? { |auth| auth.source.empty? } end def migrate migrated = inspect roles.replace *to_roles clear ["LEGACY AUTHORIZATION DATA", migrated, "ROLES", roles.serialize.inspect].join("\n\n") end def inspect sources.map { |auth| auth.inspect }.join("\n") end private def sources wrappers.map { |wrapper| wrapper.new(self) } end def wrappers classes = [ LegacyPermissions, LegacyRoles ] if respond_to? :default_permissions classes << LegacyDefaultPermissions end classes end end end
Version data entries
49 entries across 49 versions & 1 rubygems