Merge pull request #7280 from opf/feature/board-default

[30171][30170] Add board view by default

[ci skip]
pull/7282/head
Oliver Günther 6 years ago committed by GitHub
commit 9d2fc57f15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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 serialized: true
default: default:
- calendar - calendar
- board_view
- work_package_tracking - work_package_tracking
- news - news
- time_tracking - 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