20210914153600_issue_3194_update_permissions.rb 871 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3194UpdatePermissions < ActiveRecord::Migration[6.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. settings = %w[
  7. ticket_subject_size
  8. ticket_subject_re
  9. ticket_subject_fwd
  10. ticket_define_email_from
  11. ticket_define_email_from_separator
  12. postmaster_max_size
  13. postmaster_follow_up_search_in
  14. postmaster_sender_based_on_reply_to
  15. postmaster_sender_is_agent_search_for_customer
  16. postmaster_send_reject_if_mail_too_large
  17. notification_sender
  18. send_no_auto_response_reg_exp
  19. ]
  20. Setting.where(name: settings).each do |setting|
  21. setting.preferences[:permission] += ['admin.channel_google', 'admin.channel_microsoft365']
  22. setting.save
  23. end
  24. end
  25. end