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

29 lines
871 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://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