20200724130426_issue3128_add_sso.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3128AddSso < ActiveRecord::Migration[5.2]
  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: 'Authentication via %s',
  8. name: 'auth_sso',
  9. area: 'Security::ThirdPartyAuthentication',
  10. description: 'Enables button for user authentication via %s. The button will redirect to /auth/sso on user interaction.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'auth_sso',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. preferences: {
  26. controller: 'SettingsAreaSwitch',
  27. sub: {},
  28. title_i18n: ['SSO'],
  29. description_i18n: ['SSO', 'Button for Single Sign On.'],
  30. permission: ['admin.security'],
  31. },
  32. state: false,
  33. frontend: true
  34. )
  35. end
  36. end