lib/ddr/auth/legacy_permissions.rb in ddr-models-1.13.1 vs lib/ddr/auth/legacy_permissions.rb in ddr-models-1.13.2

- old
+ new

@@ -3,31 +3,29 @@ class LegacyPermissions attr_reader :permissions LEGACY_PERMISSION_ROLE_MAP = { - "discover" => :viewer, - "read" => :viewer, - "edit" => :editor + "discover" => "Viewer", + "read" => "Viewer", + "edit" => "Editor" } def initialize(permissions) @permissions = permissions end - + def to_resource_roles to_roles(:resource) end def to_policy_roles to_roles(:policy) end def to_roles(scope) permissions.map do |perm| - Roles.build_role(:type=>role_type(perm), - agent_type(perm)=>perm[:name], - :scope=>scope) + Roles::Role.build(type: role_type(perm), agent: perm[:name], scope: scope) end end private