From ab286656b22dd686a659afe908daade6e5a54ff3 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 23 Apr 2018 15:48:26 +0000 Subject: Resolve "Namespace factory is problematic" --- lib/api/helpers/notes_helpers.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/api/helpers/notes_helpers.rb') diff --git a/lib/api/helpers/notes_helpers.rb b/lib/api/helpers/notes_helpers.rb index cd91df1ecd8..b74b8149834 100644 --- a/lib/api/helpers/notes_helpers.rb +++ b/lib/api/helpers/notes_helpers.rb @@ -64,8 +64,10 @@ module API authorize! :create_note, noteable parent = noteable_parent(noteable) + if opts[:created_at] - opts.delete(:created_at) unless current_user.admin? || parent.owner == current_user + opts.delete(:created_at) unless + current_user.admin? || parent.owned_by?(current_user) end project = parent if parent.is_a?(Project) -- cgit v1.2.1