- Add show permission to all roles - Add to default settingspull/7280/head
parent
1e682fb5d4
commit
509d800238
@ -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…
Reference in new issue