20200724130426_issue3128_add_sso.rb 1.0 KB

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