20201005084847_agent_customer_permission.rb 361 B

123456789101112
  1. class AgentCustomerPermission < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Permission.where(name: ['ticket.agent', 'ticket.customer', 'chat.agent', 'cti.agent']).each do |permission|
  6. permission.preferences.delete(:not)
  7. permission.save!
  8. end
  9. end
  10. end