diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-16 17:17:09 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-16 17:35:15 +0300 |
commit | d47fca53db5840e85d38b35058d4bbd94ea917db (patch) | |
tree | ede2db2153f40e4b929a65d166206b369c45a90f /app | |
parent | 1263708d81dcb978b44139a2965d384dff310fcc (diff) |
Allow commit note to be visible if repo is visible
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/events_helper.rb | 4 | ||||
-rw-r--r-- | app/models/event.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 00e64076408..f1a0b929d82 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -86,7 +86,7 @@ module EventsHelper elsif event.merge_request? namespace_project_merge_request_url(event.project.namespace, event.project, event.merge_request) - elsif event.note? && event.commit_note? + elsif event.commit_note? namespace_project_commit_url(event.project.namespace, event.project, event.note_target) elsif event.note? @@ -127,7 +127,7 @@ module EventsHelper end def event_note_target_path(event) - if event.note? && event.commit_note? + if event.commit_note? namespace_project_commit_path(event.project.namespace, event.project, event.note_target, diff --git a/app/models/event.rb b/app/models/event.rb index c76d88b1c7b..21eaca917b8 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -62,7 +62,7 @@ class Event < ActiveRecord::Base end def visible_to_user?(user = nil) - if push? + if push? || commit_note? Ability.allowed?(user, :download_code, project) elsif membership_changed? true @@ -283,7 +283,7 @@ class Event < ActiveRecord::Base end def commit_note? - target.for_commit? + note? && target && target.for_commit? end def issue_note? @@ -295,7 +295,7 @@ class Event < ActiveRecord::Base end def project_snippet_note? - target.for_snippet? + note? && target && target.for_snippet? end def note_target |