lib/ddr/auth/user.rb in ddr-models-1.13.2 vs lib/ddr/auth/user.rb in ddr-models-1.14.0
- old
+ new
@@ -25,13 +25,13 @@
def find_by_user_key(key)
send("find_by_#{user_key_attribute}", key)
end
def from_omniauth(auth)
- user = find_by_user_key(auth.uid) ||
+ user = find_by_user_key(auth.uid) ||
new(user_key_attribute => auth.uid, :password => Devise.friendly_token)
- user.update!(email: auth.info.email,
+ user.update!(email: auth.info.email,
display_name: auth.info.name,
first_name: auth.info.first_name,
last_name: auth.info.last_name,
nickname: auth.info.nickname)
user
@@ -66,10 +66,10 @@
else
member_of?(Group.new(group))
end
end
alias_method :is_member_of?, :member_of?
-
+
def authorized_to_act_as_superuser?
member_of?(Groups::Superusers)
end
def principal_name