20231017091313_loop_protection_settings.rb 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class LoopProtectionSettings < ActiveRecord::Migration[7.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Ticket Trigger Loop Protection Articles per Ticket',
  8. name: 'ticket_trigger_loop_protection_articles_per_ticket',
  9. area: 'Ticket::Core',
  10. description: 'Defines the configuration how many articles can be created in a minute range per ticket.',
  11. options: {},
  12. state: {
  13. 10 => 10,
  14. 30 => 15,
  15. 60 => 25,
  16. 180 => 50,
  17. 600 => 100,
  18. },
  19. preferences: {
  20. permission: ['admin.ticket'],
  21. hidden: true,
  22. },
  23. frontend: false
  24. )
  25. Setting.create_if_not_exists(
  26. title: 'Ticket Trigger Loop Protection Articles Total',
  27. name: 'ticket_trigger_loop_protection_articles_total',
  28. area: 'Ticket::Core',
  29. description: 'Defines the configuration how many articles can be created in a minute range globally.',
  30. options: {},
  31. state: {
  32. 10 => 30,
  33. 30 => 60,
  34. 60 => 120,
  35. 180 => 240,
  36. 600 => 360,
  37. },
  38. preferences: {
  39. permission: ['admin.ticket'],
  40. hidden: true,
  41. },
  42. frontend: false
  43. )
  44. end
  45. end