GRN2-310: Share Access now dynamically pulls the list of users from the server (#2380)

* Share Access now dynamically pulls the list of users from the server

* Merge users now dynamically pulls the list of users from the server

* Only return the information needed to the front-end
This commit is contained in:
Ahmad Farhat
2020-12-21 17:21:17 -05:00
committed by GitHub
parent 155d214215
commit 86e6056d3c
11 changed files with 111 additions and 40 deletions

View File

@ -65,27 +65,6 @@ module Populator
end
end
# Returns a list of users that are in the same context of the current user
def shared_user_list
roles_can_appear = []
Role.where(provider: @user_domain).each do |role|
roles_can_appear << role.name if role.get_permission("can_appear_in_share_list") && role.priority >= 0
end
initial_list = User.where.not(uid: current_user.uid).with_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.without_role(:super_admin).where.not(uid: current_user.uid)
return initial_list unless Rails.configuration.loadbalanced_configuration
initial_list.where(provider: @user_domain)
end
# Returns a list off all current invitations
def invited_users_list
list = if Rails.configuration.loadbalanced_configuration