GRN2-260: Added the ability to merge user accounts (#938)

* Added the ability to merge user accounts

* Styling fixes
This commit is contained in:
Ahmad Farhat
2020-02-14 10:24:06 -05:00
committed by GitHub
parent 31258272c2
commit 005c738e4d
13 changed files with 222 additions and 5 deletions

View File

@ -77,7 +77,18 @@ module Populator
roles_can_appear << role.name if role.get_permission("can_appear_in_share_list") && role.name != "super_admin"
end
initial_list = User.where.not(uid: current_user.uid).with_highest_priority_role(roles_can_appear)
initial_list = User.where.not(uid: current_user.uid)
.without_role(:pending)
.without_role(:denied)
.with_highest_priority_role(roles_can_appear)
return initial_list unless Rails.configuration.loadbalanced_configuration
initial_list.where(provider: @user_domain)
end
# Returns a list of users that can merged into another user
def merge_user_list
initial_list = User.where.not(uid: current_user.uid).without_role(:super_admin)
return initial_list unless Rails.configuration.loadbalanced_configuration
initial_list.where(provider: @user_domain)