diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-08-31 14:31:14 +0200 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-14 14:50:32 +0200 |
commit | 2b82f907abf2074ac332531d6142893d081f44b9 (patch) | |
tree | e08d881ca7af79869f7e227546192995388d12ef /app/policies | |
parent | 3d2917bf2e4799a7ba9bcb518c39605eca0a4b1d (diff) | |
download | gitlab-ce-2b82f907abf2074ac332531d6142893d081f44b9.tar.gz |
Check the discussion lock only for issuables & clean style
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/note_policy.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/policies/note_policy.rb b/app/policies/note_policy.rb index 5d51fbf4f4a..307c514a74b 100644 --- a/app/policies/note_policy.rb +++ b/app/policies/note_policy.rb @@ -7,7 +7,7 @@ class NotePolicy < BasePolicy condition(:is_noteable_author) { @user && @subject.noteable.author_id == @user.id } condition(:editable, scope: :subject) { @subject.editable? } - condition(:locked) { @subject.noteable.discussion_locked? } + condition(:locked) { [MergeRequest, Issue].include?(@subject.noteable.class) && @subject.noteable.discussion_locked? } rule { ~editable | anonymous }.prevent :edit_note |