trabajo-afectivo/db/migrate/20210914153600_issue_3194_update_permissions.rb

29 lines
870 B
Ruby
Raw Permalink Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
class Issue3194UpdatePermissions < ActiveRecord::Migration[6.0]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
settings = %w[
ticket_subject_size
ticket_subject_re
ticket_subject_fwd
ticket_define_email_from
ticket_define_email_from_separator
postmaster_max_size
postmaster_follow_up_search_in
postmaster_sender_based_on_reply_to
postmaster_sender_is_agent_search_for_customer
postmaster_send_reject_if_mail_too_large
notification_sender
send_no_auto_response_reg_exp
]
Setting.where(name: settings).each do |setting|
setting.preferences[:permission] += ['admin.channel_google', 'admin.channel_microsoft365']
setting.save
end
end
end