diff options
author | Sean McGivern <sean@gitlab.com> | 2019-05-02 11:13:42 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-05-02 11:13:42 +0100 |
commit | c1892f6c9000cacafae4f6c8992ba6c1128c8c95 (patch) | |
tree | 237c2955a1514b9be6b8b09c4bdb16323573641a /app/helpers/notes_helper.rb | |
parent | acb55198b4a05a0b4ac2662bf68cfeb3d744ca01 (diff) | |
download | gitlab-ce-c1892f6c9000cacafae4f6c8992ba6c1128c8c95.tar.gz |
Remove the `comment_personal_snippet` permissionremove-comment-personal-snippet-permission
This is now entirely handled by `create_note`:
1. Project snippets prevent `create_note`.
2. Uploads already only support routing for personal snippets.
This simplifies some policies and access checks, too!
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r-- | app/helpers/notes_helper.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index a50137bea3d..2e31a5e2ed4 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -128,15 +128,9 @@ module NotesHelper end def can_create_note? - issuable = @issue || @merge_request + noteable = @issue || @merge_request || @snippet || @project - 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 + can?(current_user, :create_note, noteable) end def initial_notes_data(autocomplete) |