Class: Ddr::Auth::LegacyRoles

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ddr/auth/legacy/legacy_roles.rb

Instance Method Summary collapse

Instance Method Details

#clearObject



16
17
18
# File 'lib/ddr/auth/legacy/legacy_roles.rb', line 16

def clear
  source.clear
end

#inspectObject



20
21
22
# File 'lib/ddr/auth/legacy/legacy_roles.rb', line 20

def inspect
  "DOWNLOADER: #{source.inspect}"
end

#sourceObject



6
7
8
# File 'lib/ddr/auth/legacy/legacy_roles.rb', line 6

def source
  .downloader
end

#to_rolesObject



10
11
12
13
14
# File 'lib/ddr/auth/legacy/legacy_roles.rb', line 10

def to_roles
  source.each_with_object(Roles::DetachedRoleSet.new) do |agent, memo|
    memo.grant Roles::Role.build(type: Roles::DOWNLOADER, agent: agent, scope: Roles::RESOURCE_SCOPE)
  end
end