diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-08-30 17:57:50 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-14 15:50:32 +0300 |
commit | b9287208523e1a5c05939fe0db038df51a9082fc (patch) | |
tree | 7cc859ffab52ae526924676395374d4621fd96c3 /app/helpers/notes_helper.rb | |
parent | 1140fcce4f8b5463f451356b76fea125826478b2 (diff) |
Support discussion locking in the backend
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r-- | app/helpers/notes_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index ce028195e51..c219aa3d6a9 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -130,8 +130,12 @@ module NotesHelper end def can_create_note? + issuable = @issue || @merge_request + if @snippet.is_a?(PersonalSnippet) can?(current_user, :comment_personal_snippet, @snippet) + elsif issuable + can?(current_user, :create_note, issuable) else can?(current_user, :create_note, @project) end |