diff options
| author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-24 14:20:47 -0300 |
|---|---|---|
| committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-03-24 14:22:01 -0300 |
| commit | 239560331ab5ef635a8739f5b2b85d0bcd531256 (patch) | |
| tree | 45c205cb6cc65f5c531faa386064b11217c4b909 /app/models | |
| parent | 6b95be1ddd144e24a61564349fa550b3a98336c7 (diff) | |
| download | gitlab-ce-239560331ab5ef635a8739f5b2b85d0bcd531256.tar.gz | |
Comments on confidential issues doesn't show in activity feed to non-members
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/event.rb | 8 |
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 |
