]> source.dussan.org Git - redmine.git/commitdiff
Fixed: associated changesets from other projects are not visible if the current proje...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 2 Feb 2012 17:43:36 +0000 (17:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 2 Feb 2012 17:43:36 +0000 (17:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8749 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
test/functional/issues_controller_test.rb

index 9a64ba062914e655d97addcbeea3396a8e502fe5..b7f4a7c84ff54b9502e5c4639ce0d3563ba57583 100644 (file)
@@ -109,10 +109,8 @@ class IssuesController < ApplicationController
     @journals.each_with_index {|j,i| j.indice = i+1}
     @journals.reverse! if User.current.wants_comments_in_reverse_order?
 
-    if User.current.allowed_to?(:view_changesets, @project)
-      @changesets = @issue.changesets.visible.all
-      @changesets.reverse! if User.current.wants_comments_in_reverse_order?
-    end
+    @changesets = @issue.changesets.visible.all
+    @changesets.reverse! if User.current.wants_comments_in_reverse_order?
 
     @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
     @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
index a41340ae669f85387cb1420de3f84f51277e52df..eb75f073d72e508293c20a3060b901f115f5c2c5 100644 (file)
@@ -41,7 +41,9 @@ class IssuesControllerTest < ActionController::TestCase
            :time_entries,
            :journals,
            :journal_details,
-           :queries
+           :queries,
+           :repositories,
+           :changesets
 
   include Redmine::I18n
 
@@ -1074,6 +1076,18 @@ class IssuesControllerTest < ActionController::TestCase
     assert_no_tag 'a', :content => /Next/
   end
 
+  def test_show_should_display_visible_changesets_from_other_projects
+    project = Project.find(2)
+    issue = project.issues.first
+    issue.changeset_ids = [102]
+    issue.save!
+    project.disable_module! :repository
+
+    @request.session[:user_id] = 2
+    get :show, :id => issue.id
+    assert_tag 'a', :attributes => {:href => "/projects/ecookbook/repository/revisions/3"}
+  end
+
   def test_show_with_multi_custom_field
     field = CustomField.find(1)
     field.update_attribute :multiple, true