Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove doubled code

Henriette Darge6885ee64e393
diff --git a/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb b/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb
index 6e7f275d558..0eb9386ff5c 100644
--- a/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb
+++ b/modules/team_planner/app/controllers/team_planner/team_planner_controller.rb
@@ -3,10 +3,6 @@ module ::TeamPlanner
before_action :find_optional_project
before_action :authorize
- # The team planner permission alone does not suffice
- # to view work packages
- before_action :authorize_work_package_permission
-
menu_item :team_planner_view
def index
@@ -16,13 +12,5 @@ module ::TeamPlanner
current_menu_item :index do
:team_planner_view
end
-
- private
-
- def authorize_work_package_permission
- unless current_user.allowed_to?(:view_work_packages, @project, global: @project.nil?)
- deny_access
- end
- end
end
end
diff --git a/modules/team_planner/spec/routing/team_planner_routing_spec.rb b/modules/team_planner/spec/routing/team_planner_routing_spec.rb
index fbe5418741f..cc9beb9e9c4 100644
--- a/modules/team_planner/spec/routing/team_planner_routing_spec.rb
+++ b/modules/team_planner/spec/routing/team_planner_routing_spec.rb
@@ -30,7 +30,7 @@ require 'spec_helper'
describe 'Team planner routing', type: :routing do
it 'routes to team_planner#index' do
- is_expected
+ expect(subject)
.to route(:get, '/projects/foobar/team_planner/state')
.to(controller: 'team_planner/team_planner', action: 'index', project_id: 'foobar', state: 'state')
end