20130817000001_update_auth.rb 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. class UpdateAuth < ActiveRecord::Migration
  2. def up
  3. Setting.create_or_update(
  4. :title => 'Authentication via OTRS',
  5. :name => 'auth_otrs',
  6. :area => 'Security::Authentication',
  7. :description => 'Enables user authentication via OTRS.',
  8. :state => {
  9. :adapter => 'Auth::Otrs',
  10. :required_group_ro => 'stats',
  11. :group_rw_role_map => {
  12. 'admin' => 'Admin',
  13. 'stats' => 'Report',
  14. },
  15. :group_ro_role_map => {
  16. 'stats' => 'Report',
  17. },
  18. :always_role => {
  19. 'Agent' => true,
  20. },
  21. },
  22. :frontend => false
  23. )
  24. Setting.create_or_update(
  25. :title => 'Authentication via LDAP',
  26. :name => 'auth_ldap',
  27. :area => 'Security::Authentication',
  28. :description => 'Enables user authentication via LDAP.',
  29. :state => {
  30. :adapter => 'Auth::Ldap',
  31. :host => 'localhost',
  32. :port => 389,
  33. :bind_dn => 'cn=Manager,dc=example,dc=org',
  34. :bind_pw => 'example',
  35. :uid => 'mail',
  36. :base => 'dc=example,dc=org',
  37. :always_filter => '',
  38. :always_roles => ['Admin', 'Agent'],
  39. :always_groups => ['Users'],
  40. :sync_params => {
  41. :firstname => 'sn',
  42. :lastname => 'givenName',
  43. :email => 'mail',
  44. :login => 'mail',
  45. },
  46. },
  47. :frontend => false
  48. )
  49. end
  50. def down
  51. end
  52. end