20221121193551_issue_4368_user_preferences_appearance.rb 593 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4368UserPreferencesAppearance < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Permission.create_if_not_exists(
  7. name: 'user_preferences.appearance',
  8. note: 'Manage %s',
  9. preferences: {
  10. translations: ['Appearance']
  11. },
  12. allow_signup: true,
  13. )
  14. customer = Role.find_by(name: 'Customer')
  15. customer&.permission_grant('user_preferences.appearance')
  16. end
  17. end