Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-03-24 20:20:47 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-03-24 20:22:01 +0300
commit239560331ab5ef635a8739f5b2b85d0bcd531256 (patch)
tree45c205cb6cc65f5c531faa386064b11217c4b909 /app/models/event.rb
parent6b95be1ddd144e24a61564349fa550b3a98336c7 (diff)
Comments on confidential issues doesn't show in activity feed to non-members
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index a5cfeaf388e..2b963d4f2f6 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -80,8 +80,8 @@ class Event < ActiveRecord::Base
true
elsif created_project?
true
- elsif issue?
- Ability.abilities.allowed?(user, :read_issue, issue)
+ elsif issue? || issue_note?
+ Ability.abilities.allowed?(user, :read_issue, note? ? note_target : target)
else
((merge_request? || note?) && target) || milestone?
end
@@ -298,6 +298,10 @@ class Event < ActiveRecord::Base
target.noteable_type == "Commit"
end
+ def issue_note?
+ note? && target && target.noteable_type == "Issue"
+ end
+
def note_project_snippet?
target.noteable_type == "Snippet"
end