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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#38954] IFC upload not working since attachment whitelisting
Wieland Lindenthal3a4687ff9f6e
diff --git a/modules/bim/app/models/bim/ifc_models/ifc_model.rb b/modules/bim/app/models/bim/ifc_models/ifc_model.rbindex 940acb76fe1..6499e433d06 100644--- a/modules/bim/app/models/bim/ifc_models/ifc_model.rb+++ b/modules/bim/app/models/bim/ifc_models/ifc_model.rb@@ -13,7 +13,7 @@ module Bimscope :defaults, -> { where(is_default: true) }- %i(ifc xkt metadata).each do |name|+ %i(ifc xkt).each do |name|define_method "#{name}_attachment" doget_attached_type(name)end@@ -27,7 +27,7 @@ module Bimdelete_attachment namecall = ::Attachments::CreateService.bypass_whitelist(user: User.current)- .call(file: file, container: self, filename: file.original_filename, description: name)+ .call(file: file, container: self, filename: File.basename(file.path), description: name)call.on_failure { Rails.logger.error "Failed to add #{name} attachment: #{call.message}" }enddiff --git a/modules/bim/app/services/bim/ifc_models/set_attributes_service.rb b/modules/bim/app/services/bim/ifc_models/set_attributes_service.rbindex b703ceee161..a28c1b2934e 100644--- a/modules/bim/app/services/bim/ifc_models/set_attributes_service.rb+++ b/modules/bim/app/services/bim/ifc_models/set_attributes_service.rb@@ -34,6 +34,7 @@ module Bimprotecteddef set_attributes(params)+ model.project = params[:project]set_ifc_attachment(params.delete(:ifc_attachment))superdiff --git a/modules/bim/spec/features/bcf/direct_ifc_upload_spec.rb b/modules/bim/spec/features/ifc_models/direct_ifc_upload_spec.rbsimilarity index 100%rename from modules/bim/spec/features/bcf/direct_ifc_upload_spec.rbrename to modules/bim/spec/features/ifc_models/direct_ifc_upload_spec.rb