lib/ddr/auth/user.rb in ddr-models-1.13.1 vs lib/ddr/auth/user.rb in ddr-models-1.13.2
- old
+ new
@@ -46,29 +46,27 @@
def to_s
user_key
end
def to_agent
- Person.build(self)
+ principal_name
end
- alias_method :to_person, :to_agent
alias_method :agent, :to_agent
- alias_method :person, :to_agent
def ability
@ability ||= ::Ability.new(self)
end
def groups
- @groups ||= Groups.new(self)
+ @groups ||= Groups.build(self)
end
def member_of?(group)
if group.is_a? Group
groups.include?(group)
else
- member_of?(Group.build(group))
+ member_of?(Group.new(group))
end
end
alias_method :is_member_of?, :member_of?
def authorized_to_act_as_superuser?
@@ -80,10 +78,10 @@
end
alias_method :name, :principal_name
alias_method :eppn, :principal_name
def agents
- groups + [person]
+ groups.agents + [agent]
end
def principals
groups.map(&:to_s) + [principal_name]
end