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

Restrict time entries to visible projects

Klaus Zanders9302a83eef9d
diff --git a/modules/costs/app/controllers/my/time_tracking_controller.rb b/modules/costs/app/controllers/my/time_tracking_controller.rb
index ad9260c3684..6111bd14d60 100644
--- a/modules/costs/app/controllers/my/time_tracking_controller.rb
+++ b/modules/costs/app/controllers/my/time_tracking_controller.rb
@@ -115,6 +115,7 @@ module My
def load_time_entries(time_scope)
@time_entries = TimeEntry
.includes(:project, :activity, { work_package: :status })
+ .where(project_id: Project.visible.select(:id))
.where(user: User.current, spent_on: time_scope)
.order(:spent_on, :start_time, :hours)
end