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

Add meaningful comment to clarify condition.

Pavel Balashou39dc644d0744
diff --git a/modules/storages/app/services/storages/group_folder_properties_sync_service.rb b/modules/storages/app/services/storages/group_folder_properties_sync_service.rb
index c823ea26362..08f7d19570c 100644
--- a/modules/storages/app/services/storages/group_folder_properties_sync_service.rb
+++ b/modules/storages/app/services/storages/group_folder_properties_sync_service.rb
@@ -205,6 +205,9 @@ class Storages::GroupFolderPropertiesSyncService
.where(oauth_client: @storage.oauth_client)
.where.not(id: @admin_tokens_query)
.includes(:user)
+ # The user scope is required in all cases except one:
+ # when the project is public and non member has at least one storage permission
+ # then all non memebers should have access to the project folder
if !(project.public? && Role.non_member.permissions.intersect?(PERMISSIONS_KEYS))
tokens_query = tokens_query.where(users: project.users)
end