##// END OF EJS Templates
Fixed: version files in Files module cannot be downloaded if issue tracking is disabled (#9055)....
Jean-Philippe Lang -
r7864:d92c204ed389
parent child
Show More
@@ -43,6 +43,11 class Version < ActiveRecord::Base
43 user.allowed_to?(:view_issues, self.project)
43 user.allowed_to?(:view_issues, self.project)
44 end
44 end
45
45
46 # Version files have same visibility as project files
47 def attachments_visible?(*args)
48 project.present? && project.attachments_visible?(*args)
49 end
50
46 def start_date
51 def start_date
47 @start_date ||= fixed_issues.minimum('start_date')
52 @start_date ||= fixed_issues.minimum('start_date')
48 end
53 end
@@ -102,7 +102,7 attachments_009:
102 container_type: Version
102 container_type: Version
103 container_id: 1
103 container_id: 1
104 downloads: 0
104 downloads: 0
105 disk_filename: 060719210727_version_file.zip
105 disk_filename: 060719210727_archive.zip
106 digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
106 digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
107 id: 9
107 id: 9
108 filesize: 452
108 filesize: 452
@@ -198,6 +198,12 class AttachmentsControllerTest < ActionController::TestCase
198 set_tmp_attachments_directory
198 set_tmp_attachments_directory
199 end
199 end
200
200
201 def test_download_version_file_with_issue_tracking_disabled
202 Project.find(1).disable_module! :issue_tracking
203 get :download, :id => 9
204 assert_response :success
205 end
206
201 def test_download_should_assign_content_type_if_blank
207 def test_download_should_assign_content_type_if_blank
202 Attachment.find(4).update_attribute(:content_type, '')
208 Attachment.find(4).update_attribute(:content_type, '')
203
209
General Comments 0
You need to be logged in to leave comments. Login now