[30171][30170] Add board view by default

- Add show permission to all roles
- Add to default settings
pull/7280/head
Oliver Günther 6 years ago
parent 1e682fb5d4
commit 509d800238
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 1
      config/settings.yml
  2. 20
      db/migrate/20190507132517_add_board_view_to_roles.rb

@ -284,6 +284,7 @@ default_projects_modules:
serialized: true
default:
- calendar
- board_view
- work_package_tracking
- news
- time_tracking

@ -0,0 +1,20 @@
class AddBoardViewToRoles < ActiveRecord::Migration[5.2]
def up
Role
.joins(:role_permissions)
.where("role_permissions.permission = 'view_work_packages'")
.references(:role_permissions)
.find_each do |role|
role.add_permission! :show_board_views
end
unless Setting.default_projects_modules.include?('board_view')
Setting.default_projects_modules = Setting.default_projects_mdoules + ['board_view']
end
end
def down
# Nothing to do
end
end
Loading…
Cancel
Save