diff options
author | Valery Sizov <valery@gitlab.com> | 2016-10-04 15:52:08 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-10-11 16:51:26 +0300 |
commit | b4004488f76d7360acd2f38277d617447c76b888 (patch) | |
tree | d52552cccf8b51ba4e099f0afbb05bf94a1a1472 /app/models/event.rb | |
parent | a3169d522a0db269770141a1b30c3df5acee82f3 (diff) |
Make guests unable to view MRs
Diffstat (limited to 'app/models/event.rb')
-rw-r--r-- | app/models/event.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index 314d5ba438f..0764cb8cabd 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -68,8 +68,10 @@ class Event < ActiveRecord::Base true elsif issue? || issue_note? Ability.allowed?(user, :read_issue, note? ? note_target : target) + elsif merge_request? || merge_request_note? + Ability.allowed?(user, :read_merge_request, note? ? note_target : target) else - ((merge_request? || note?) && target.present?) || milestone? + milestone? end end @@ -280,6 +282,10 @@ class Event < ActiveRecord::Base note? && target && target.for_issue? end + def merge_request_note? + note? && target && target.for_merge_request? + end + def project_snippet_note? target.for_snippet? end |