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

Use correct permission check for :log_time permission

Klaus Zanders1487000cbf5c
diff --git a/modules/costs/app/components/my/time_tracking/sub_header_component.rb b/modules/costs/app/components/my/time_tracking/sub_header_component.rb
index 5365d41dbff..aa37f01c2b1 100644
--- a/modules/costs/app/components/my/time_tracking/sub_header_component.rb
+++ b/modules/costs/app/components/my/time_tracking/sub_header_component.rb
@@ -92,7 +92,7 @@ module My
end
def can_create_time_entry?
- User.current.allowed_in_any_work_package?(:log_own_time) || User.current.allowed_in_project?(:log_time)
+ User.current.allowed_in_any_work_package?(:log_own_time) || User.current.allowed_in_any_project?(:log_time)
end
end
end
diff --git a/modules/costs/app/components/my/time_tracking/time_entries_list_component.rb b/modules/costs/app/components/my/time_tracking/time_entries_list_component.rb
index 9cbf0e7cb85..6e6877449c6 100644
--- a/modules/costs/app/components/my/time_tracking/time_entries_list_component.rb
+++ b/modules/costs/app/components/my/time_tracking/time_entries_list_component.rb
@@ -90,7 +90,7 @@ module My
end
def can_create_time_entry?
- User.current.allowed_in_any_work_package?(:log_own_time) || User.current.allowed_in_project?(:log_time)
+ User.current.allowed_in_any_work_package?(:log_own_time) || User.current.allowed_in_any_project?(:log_time)
end
end
end