1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

(bug) Fix admin group being replaced in SSO authentication

This commit is contained in:
Guilherme Chaguri 2022-07-14 17:03:22 -03:00
parent 157774f525
commit 6423255116

View File

@ -121,7 +121,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')
set_data_from_sso_mapping(field, value) unless (field == 'user.email' && value.end_with?('-duplicate')) || (field == 'user.group_id' && user.admin?)
end
# run the account transfer in an SQL transaction to ensure data integrity