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

Fix tests and revert changes

Klaus Zanders5b0b591fe11f
diff --git a/modules/backlogs/app/controllers/work_package_boxes_controller.rb b/modules/backlogs/app/controllers/work_package_boxes_controller.rb
index 58f8dde2e29..070c089d477 100644
--- a/modules/backlogs/app/controllers/work_package_boxes_controller.rb
+++ b/modules/backlogs/app/controllers/work_package_boxes_controller.rb
@@ -39,7 +39,7 @@ class WorkPackageBoxesController < WorkPackagesController
r.other_work_package(@work_package) && r.other_work_package(@work_package).visible?
end
@allowed_statuses = WorkPackages::UpdateContract.new(work_package, User.current).assignable_statuses
- @edit_allowed = User.current.allowed_in_work_package?(:edit_work_packages, @@work_package)
+ @edit_allowed = User.current.allowed_in_work_package?(:edit_work_packages, @work_package)
@priorities = IssuePriority.all
@time_entry = TimeEntry.new
diff --git a/modules/backlogs/app/views/rb_impediments/_impediment.html.erb b/modules/backlogs/app/views/rb_impediments/_impediment.html.erb
index 110be7183d4..655e00857bf 100644
--- a/modules/backlogs/app/views/rb_impediments/_impediment.html.erb
+++ b/modules/backlogs/app/views/rb_impediments/_impediment.html.erb
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<% prevent_edit = User.current.allowed_in_work_package?(:edit_work_packages, impediment) ? '' : 'prevent_edit'%>
+<% prevent_edit = User.current.allowed_in_project?(:edit_work_packages, defined?(project) ? project : impediment.project) ? '' : 'prevent_edit'%>
<div class="model work_package impediment <%= color_contrast_class(impediment) %> <%= prevent_edit %> <%= mark_if_closed(impediment) %><%= color_contrast_class(impediment) %>" id="work_package_<%= impediment.id %>" <%= build_inline_style(impediment) %>>
<div class="id">
<div class="t"><%= work_package_link_or_empty(impediment) %></div>
diff --git a/modules/backlogs/app/views/rb_tasks/_task.html.erb b/modules/backlogs/app/views/rb_tasks/_task.html.erb
index 09a609b574b..cc6a54ba979 100644
--- a/modules/backlogs/app/views/rb_tasks/_task.html.erb
+++ b/modules/backlogs/app/views/rb_tasks/_task.html.erb
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<% prevent_edit = User.current.allowed_in_work_package?(:edit_work_packages, task) ? '' : 'prevent_edit'%>
+<% prevent_edit = User.current.allowed_in_project?(:edit_work_packages, defined?(project) ? project : task.project) ? '' : 'prevent_edit'%>
<div class="model work_package task <%= color_contrast_class(task) %> <%= prevent_edit %> <%= mark_if_closed(task) %>" id="work_package_<%= task.id %>" <%= build_inline_style(task) %>>
<div class="id">
<div class="t"><%= work_package_link_or_empty(task) %></div>