add data migration to change zoom user default settings
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class ChangeExistingZoomUsersSettings < ActiveRecord::DataMigration
|
||||
def up
|
||||
gateway = ZoomGateway.new
|
||||
|
||||
ZoomUser.find_each do |zu|
|
||||
gateway.update_user_settings zu.api_id
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -69,6 +69,23 @@ class ZoomGateway
|
||||
parse_zoom_error(e)
|
||||
end
|
||||
|
||||
# Update user with custom settings
|
||||
def update_user_settings(user_id)
|
||||
custom_defaults = {
|
||||
id: user_id,
|
||||
in_meeting: {
|
||||
auto_saving_chat: true,
|
||||
co_host: true,
|
||||
non_verbal_feedback: true,
|
||||
breakout_room: true,
|
||||
group_hd: true,
|
||||
far_end_camera_control: true,
|
||||
allow_live_streaming: true
|
||||
}
|
||||
}
|
||||
@client.user_settings_update custom_defaults
|
||||
end
|
||||
|
||||
def create_host(host_email)
|
||||
# Find role
|
||||
host_role = @client.roles_list["roles"].try(:select) { |r| r["name"] == self.class.HOST_ROLE }.try(:first)
|
||||
@@ -86,20 +103,7 @@ class ZoomGateway
|
||||
type: self.class.USER_TYPE
|
||||
})
|
||||
|
||||
# Update user with custom settings
|
||||
custom_defaults = {
|
||||
id: host_user["id"],
|
||||
in_meeting: {
|
||||
auto_saving_chat: true,
|
||||
co_host: true,
|
||||
non_verbal_feedback: true,
|
||||
breakout_room: true,
|
||||
group_hd: true,
|
||||
far_end_camera_control: true,
|
||||
allow_live_streaming: true
|
||||
}
|
||||
}
|
||||
@client.user_settings_update custom_defaults
|
||||
update_user_settings(host_user["id"])
|
||||
|
||||
# Assign role to user
|
||||
@client.roles_assign role_id: host_role["id"], members: [{id: host_user["id"]}]
|
||||
|
||||
Reference in New Issue
Block a user