Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/work_items/callbacks/notes.rb')
-rw-r--r--app/services/work_items/callbacks/notes.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/services/work_items/callbacks/notes.rb b/app/services/work_items/callbacks/notes.rb
new file mode 100644
index 00000000000..a86e2251e81
--- /dev/null
+++ b/app/services/work_items/callbacks/notes.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module WorkItems
+ module Callbacks
+ class Notes < Base
+ def before_update
+ return unless params.present? && params.key?(:discussion_locked)
+ return unless has_permission?(:set_work_item_metadata)
+
+ work_item.discussion_locked = params[:discussion_locked]
+ end
+ end
+ end
+end