]> source.dussan.org Git - redmine.git/commitdiff
Fixed: activity shows updates of private issues (#8432).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 May 2011 07:12:38 +0000 (07:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 May 2011 07:12:38 +0000 (07:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5944 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/journal.rb
test/fixtures/journals.yml
test/unit/activity_test.rb

index cb5aad21ac5ea55629e2949c199b1895f693fa31..d0f7cc0307b0b87c9e526015efd79eab101467bb 100644 (file)
@@ -32,7 +32,6 @@ class Journal < ActiveRecord::Base
                 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}}
 
   acts_as_activity_provider :type => 'issues',
-                            :permission => :view_issues,
                             :author_key => :user_id,
                             :find_options => {:include => [{:issue => :project}, :details, :user],
                                               :conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" +
index 48280f8404503f33c489c74a1dd6bc38f71974ef..5bc81e41cf99ef2917315d4778e45353076fe97e 100644 (file)
@@ -27,3 +27,10 @@ journals_004:
   journalized_type: Issue
   user_id: 1
   journalized_id: 6
+journals_005: 
+  id: 5
+  created_on: <%= 1.days.ago.to_date.to_s(:db) %>
+  notes: "A comment on a private issue."
+  user_id: 2
+  journalized_type: Issue
+  journalized_id: 14
index 4978142ab64fbbb4a5e7f9b015cd195fcbda48bc..2ecc68848cda25bf0606f1fc524477a04fb9ca3c 100644 (file)
@@ -52,6 +52,9 @@ class ActivityTest < ActiveSupport::TestCase
     assert events.include?(Message.find(5))
     # Issue of a private project
     assert !events.include?(Issue.find(4))
+    # Private issue and comment
+    assert !events.include?(Issue.find(14))
+    assert !events.include?(Journal.find(5))
   end
 
   def test_global_activity_logged_user