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

Improve condition readablity. Add a comment.

Pavel Balashoua39ca4b5a250
diff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rb
index 7a376626770..d4a28a138a2 100644
--- a/modules/storages/lib/open_project/storages/engine.rb
+++ b/modules/storages/lib/open_project/storages/engine.rb
@@ -158,8 +158,12 @@ module OpenProject::Storages
if prj.present? && u.logged? && u.member_of?(prj) && u.allowed_in_project?(:view_file_links, prj)
prj.project_storages.each do |prj_storage|
storage = prj_storage.storage
- next unless storage.configured?
- next if prj_storage.project_folder_automatic? && !u.allowed_in_project?(:read_files, prj)
+ hide_from_menu = !storage.configured? ||
+ # the following check is required for ensure access modal final check being possible
+ # the modal waiting for read_files permission on the project folder
+ # otherwise polls backend until eternity
+ (prj_storage.project_folder_automatic? && !u.allowed_in_project?(:read_files, prj))
+ next if hide_from_menu
icon = storage.provider_type_nextcloud? ? 'nextcloud-circle' : 'hosting'
menu.push(