From 9b44492971c95b1fb80047301ffc0cede51623d1 Mon Sep 17 00:00:00 2001 From: Guilherme Chaguri Date: Tue, 16 Aug 2022 11:02:25 -0300 Subject: [PATCH] (bug) Fix user reference for admin check Fix user variable reference when verifying whether the user is an administrator --- app/models/concerns/single_sign_on_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/single_sign_on_concern.rb b/app/models/concerns/single_sign_on_concern.rb index f23a6985c..fb5bffadc 100644 --- a/app/models/concerns/single_sign_on_concern.rb +++ b/app/models/concerns/single_sign_on_concern.rb @@ -124,7 +124,7 @@ module SingleSignOnConcern logger.debug "mapping sso field #{field} with value=#{value}" # we do not merge the email field if its end with the special value '-duplicate' as this means # that the user is currently merging with the account that have the same email than the sso - set_data_from_sso_mapping(field, value) unless (field == 'user.email' && value.end_with?('-duplicate')) || (field == 'user.group_id' && user.admin?) + set_data_from_sso_mapping(field, value) unless (field == 'user.email' && value.end_with?('-duplicate')) || (field == 'user.group_id' && sso_user.admin?) end # run the account transfer in an SQL transaction to ensure data integrity