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

ProjectQuery should only return projects that are directly assigned

Klaus Zanderscdb80e51b6a6
diff --git a/app/services/authorization/project_query.rb b/app/services/authorization/project_query.rb
index d76a430a3e0..440ba6c8873 100644
--- a/app/services/authorization/project_query.rb
+++ b/app/services/authorization/project_query.rb
@@ -33,6 +33,8 @@ class Authorization::ProjectQuery < Authorization::AbstractQuery
projects_table[:id]
.eq(members_table[:project_id])
.and(members_table[:user_id].eq(user.id))
+ .and(members_table[:entity_type].eq(nil))
+ .and(members_table[:entity_id].eq(nil))
.and(project_active_condition)
end